O'Reilly logo

HTML5 and CSS3: Visual QuickStart Guide, Seventh Edition by Bruce Hyslop, Elizabeth Castro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting the Height or Width for an Element

You can set a height and width on elements such as sectioning content, paragraphs, list items, divs, images, video, form elements, and more (Image and Image). Also, you can set phrasing content elements (which display as inline by default) to display: block; or display: inline-block; and then apply a width or height to them too. (See “Displaying and Hiding Elements” for more information about the display property.)

Limiting the container div width to 90% of the browser window gives it some air and helps it not look ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required