The Old Way Versus the New Way


In earlier versions of HTML, special tags were used to format text. For example, to format a word in a bold typeface, you would simply place it inside the <b> and </b> tags. Similarly, there was a <font> tag that could be used to specify a certain font, including its family and size, among other things. Although this system of formatting tags worked reasonably well for basic text formatting, it cluttered up the HTML language by making it difficult to distinguish between content and the code used to format content. It turned out to be bad design to use tags to mark up the information on a web page and the specifics of how that information is formatted.

The solution was to eliminate many of the formatting tags and use a separate technology for web page formatting. This technology is CSS, which stands for Cascading Style Sheets. The technology sounds a bit intimidating, but you're going to find out that it isn't difficult to use to format text. In fact, CSS lets you do a lot more interesting text formatting than you could have ever done with the old tag approach. Even so, it's important to clarify that not all the old tags were eliminated. For example, <b> and <i> are still supported and widely used to format text in bold and italics, respectively.

Although I prefer the style sheet alternatives to pretty much all presentation tags, you can't ignore the tags entirely. For this reason, this hour does double duty in showing both the tag approach and the style rule approach to basic text formatting. You'll dig much deeper into CSS style rules later in the book in Part III, "Creative Web Page Design." In this hour, the emphasis is on presenting you with the alternatives to text formatting when it comes to the old tag approach and the newer style rule approach.




SAMS Teach Yourself HTML and CSS in 24 Hours
Sams Teach Yourself HTML and CSS in 24 Hours (7th Edition)
ISBN: 0672328410
EAN: 2147483647
Year: 2005
Pages: 345

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net