The margin property sets the margins around an element.
The margins of the image can be set by applying this property to the IMG element.
#example {
margin: 5px;
}
| Property | Value | Explanation |
|---|---|---|
| margin | length, %, or auto | the top, bottom, left, and right margins |
The vertical margins : 30px, The horizontal margins : 60px
<html> <head> <title>TAG index</title> <style type="text/css"> #example { width: 100%; } #example img { float: left; margin: 30px 60px; } </style> </head> <body> <div id="example"> <img src="image/photo.jpg" alt="Example" width="200" height="133"> <p> Some text Some text.<br> Some text Some text ... </p> </div> </body> </html>
Some text Some text.
Some text Some text.
Some text Some text.
Some text Some text.
Some text Some text.
Some text Some text.
Some text Some text.
Some text Some text.
Some text Some text.
Some text Some text.
Some text Some text.
Some text Some text.
Some text Some text.
Some text Some text.
Some text Some text.
Some text Some text.
Some text Some text.