CHAPTER 10

Controlling Page Layout

Want to create complex layouts on your web pages, beyond what is possible using HTML5 alone? This chapter shows you how to precisely position text, images, and other elements on your pages using style sheets. Style sheets enable you to place content at set coordinates within your layout. You can also control the spacing around your page elements, wrap text around images and tables, and even overlap content.

image

Control Layout

Set Width and Height for an Element

Use Relative Positioning

Use Absolute Positioning

Use Fixed Positioning

Set Margins

Add Padding

Align Elements Horizontally

Control the Overlap of Elements ...

Get Teach Yourself Visually™ HTML5 now with the O’Reilly learning platform.

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