iframe width, iframe height attributes
The width and height attributes on the iframe element:
- the width attribute allows you to specify the width of the iframe
- the height attribute allows you to specify the height of the iframe
width and height attributes:
- their value must be a valid positive integer (a positive whole number) expressed in pixels (CSS pixels): e.g. width="200" height="150"
- are optional attributes
Examples
<iframe | attribute | = | "value(s)" | > | ... | <⁄iframe> | Examples |
---|---|---|---|---|---|---|---|
1. | width | = | pixels | <width="200"> ... <⁄ > | |||
2. | height | = | pixels | <height="100"> ... <⁄ > |
Video demonstration iframe width, height attributes
HTML5 iframe width, height attributes Tutorial
min | video details |
---|---|
00:07 | width and height attributes on iframe, video tutorial |
00:08 | the width and height attributes allows you to specify the width and the height of the iframe (the nesting browsing context) |
00:13 | we will set the width and the height of this iframe |
00:17 | the width attribute allows you to specify the width of the iframe value: CSS pixels (positive integer) |
00:23 | the iframe has a width of 50px |
00:27 | the height attribute allows you to specify the height of the iframe value: CSS pixels (positive integer) |
00:31 | the iframe has a height of 100px |
00:35 | the dimensions of the iframe can be modified (your choice) |