Chapter 3. Creating a Web Page Layout with HTML and CSS

In This Chapter

  • Considering the benefits of using CSS

  • Learning some simple CSS

  • Using cool style tricks

In Book III, Chapter 2 you explore a basic HTML document and find some basics about creating an HTML page. This chapter shows you how to create the accompanying Cascading Style Sheet (CSS) file. CSS is a simple language that is a flexible and powerful way to control the layouts of your Web pages. As your site grows, you will see huge benefits in ease of maintenance and the ability to repurpose or redesign sections of your site very quickly.

Introducing CSS

Before we jump into the mechanics of creating a Web page layout with HTML and CSS — what this chapter is all about — we first want to show you some reasons why using CSS is a good thing. Next, we tell you how you can use the View Source feature of a Web browser to examine other developers' code — it's a valuable way to see how things are done right (or wrong, as the case may be). We also quickly cover in this section how easy it is to use CSS with other tools, such as Dreamweaver.

Understanding why CSS can help your site — and you

We include many code examples in this chapter and the preceding one that show the old‐fashioned HTML way of doing things — as compared to the new‐fashioned CSS way. In some cases, such as with the borders and padding, the benefits of CSS are very clear. For example, you can apply borders to many different types of elements, such as paragraphs and bullets. ...

Get Building Web Sites All-in-One Desk Reference For Dummies® 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.