The margin property sets the margins around an element.
The margins of the iframe can be set by applying this property to the IFRAME 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 iframe { width: 200px; height: 100px; float: left; margin: 30px 60px; } </style> </head> <body> <div id="example"> <iframe src="example.html">Alternate content</iframe> <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.