w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



iframe width, iframe height attributes

The width and height attributes on the iframe element:

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

<iframeattribute="value(s)">...<⁄iframe>Examples
1.width=pixels<iframe width="200"> ... <⁄iframe>
2.height=pixels<iframe height="100"> ... <⁄iframe>

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)
iframe intro iframe browser display iframe parents - children iframe src vs srcdoc iframe syntax iframe name attributeiframe sandbox attributeiframe seamless attributeiframe src attributeiframe srcdoc attribute