HTML and CSS Reference
You can use pretty much any property you like with the pseudo-
selectors for links, and browsers that support them will dynami-
cally reflow the page to accommodate the change. However,
changes that affect the size of the element (such as boldfacing
the text dynamically or increasing the font size) can be jarring to
users, so use them cautiously.
In the preceding lessons, I've given you a taste of how to use CSS. You didn't get the full
flavor because I used them only within the context of the style attribute of tags. In this
lesson, I discussed how you can create style sheets either as part of a page or as a stand-
alone file that can be included by any page. I also moved beyond properties that discuss
text formatting to explain how to use CSS to lay out an entire page.
By understanding how browsers render pages and how you can affect that process using
CSS, you can achieve the effects you want without writing loads of markup that's diffi-
cult to understand and maintain.
You'll continue to be introduced to new CSS properties in the lessons that follow. In
Lesson 9, I explain how to use CSS to change colors on the page, and provide all the
details on using CSS to define the backgrounds of pages and specific elements. Les-
son 13 takes a deeper look at CSS selectors and explains how to create entire page
layouts using CSS.
In this lesson, you learned about Cascading Style Sheets, the wonderful supplement to
HTML that makes formatting your pages less painful. Throughout the rest of this topic, I
use CSS where appropriate, so please review this workshop material before continuing.
Q My CSS isn't working like I'd expect. What should I do?
A CSS probably doesn't seem that clear in the first place, and things can only get
messier when you actually start applying styles to your pages. You should be sure
to test your pages in every browser you can find, and don't be afraid to experiment.
Just because something seems like it should work doesn't mean it will. The W3C
also provides a CSS Validator (http://jigsaw.w3.org/css-validator/) that you can use
to make sure that your CSS syntax is correct. You should probably use it all the
time, but even if you don't, it can still help out if you get stuck.