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 ...

Get HTML5 and CSS3: Visual QuickStart Guide, Seventh Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.