Chapter 18. Box Sizing and Offset

<feature><title>What You’ll Learn in This Hour:</title>
  • How browsers calculate the width and height dimensions of a display box

  • Which properties can control the dimensions of a box

  • What browsers will do if a box’s content exceeds the dimensions of the box, and how you can control the result with CSS

  • How to reposition a box from its original location, using relative positioning and the four offset properties

</feature>

Sizing Content

When laying out a page, it’s not always enough to specify only where content should be placed, as you can do with the float property (or the positioning properties, which you’ll learn about in this hour and the next). To create effective layouts, you need to set the size of display boxes. ...

Get Sams Teach Yourself CSS 24 in Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.