Chapter 9. Working with Margins, Padding, Alignment, and Floating
What You’ll Learn in This Chapter:
▸ How to add margins around elements
▸ How to add padding within elements
▸ How to keep everything aligned
▸ How to use the float
property
Now that you’ve learned some of the basics of creating web content, in this chapter you’ll learn the nitty-gritty of using CSS to enhance that content. In the chapters that follow, you dive in to using CSS to control aspects of your entire web page, not just individual pieces of text or graphics.
Before you tackle page layout, however, it is important to understand four particular CSS properties individually before putting them all together:
▸ The margin
and padding
properties—For adding space around elements ...
Get HTML, CSS and JavaScript All in One, Sams Teach Yourself: Covering HTML5, CSS3, and jQuery, 2nd Edition 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.