Height html Learn how to use the height attribute to specify the height of various HTML elements, such as canvas, embed, iframe, img, input, object and video. See examples, browser support and syntax. 1 width en html 2 height y width 3 margin html 4 height css 5 With the HTML element receiving a height value, the min-height value assigned to the body element gives it an initial height that matches the HTML element. This also allows the body to to grow taller if the content outgrows the visible page. The only drawback is the HTML element does not grow beyond the height of the visible viewport. 6 HTML height Attribute 7 HTML height attribute 8 HTML 9 There is no default value of HTML height attribute. Supported doctypes. HTML strict, HTML transitional, HTML frameset. For iframe, only HTML transitional. Example of HTML height attribute with img. 10 The height attribute specifies the height of an image, in pixels.. Tip: Always specify both the height and width attributes for images. If height and width are set, the space required for the image is reserved when the page is loaded. 12 The HTML height attribute is used to specify the height of the Element. It can be used on the following elements: Name. Description.