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. Throughout the previous chapter, you have learned how to use basic CSS for display purposes (such as font sizes and colors). In the chapters that follow, you’ll dive in to using CSS to control aspects of your entire web page and not just individual pieces of text or graphics.

Before tackling page layout, however, it is important to understand four particular ...

Get Sams Teach Yourself HTML, CSS and JavaScript All in One 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.