CSS is one of the strongest methods for Web designers
CSS is one of the strongest methods for Web designers to add style to a Web page. Style sheets control all of the elements of a page, such as the margins, the borders, the font, and the typeface.
In addition, you can use CSS to adjust your tables, backgrounds, and link styles. All of these elements are completely configurable within the bounds of style sheets. Let’s talk about the three types of style sheets:
Inline: Using inline style sheets lets you define the style of each element directly within the tag that precedes the word. For example, if you wanted to change the font face of a specific hyperlink to Arial, your tag might look like this: <A HREF=”something.doc” STYLE=”font: arial”>This is Arial text.</A>
Embedded: Embedded style sheets allow you to define the style for an entire Web page.To define an embedded style sheet, you add the page’s style information in the header section of the page (before the <BODY> tag). The styles are reflected throughout the page.
Linked: The linked style sheet is the strongest of all three forms, because it allows you to define an entire Web site with one style sheet.You create an external document with the suffix .css, such as mypage.css, and you link to the style sheet in the header of your page. All of the styles are loaded directly from that file. Because of this, you can make a simple change in that document, and the changes will be reflected throughout your entire site.
SO, WHAT IS CASCADING?
You’ve been hearing all about these Cascading Style Sheets, but you probably don’t even know what those three words mean. “Cascading” means that you have different levels of power in different style sheets in Web pages, inline is the most powerful, and linked is the least powerful. When you use a linked style sheet, for instance, you might change the font color of all of the paragraph text.
But what if you want a specific paragraph to be green, even though the rest of the text is black? Fortunately, inline style sheets are more powerful, overriding the linked style sheets. So, if you ever need something to go against the global linked style sheet, an inline style sheet will allow you to get the effect that you want.
Be careful with the fonts you use. Not everyone’s computer has the same fonts, and Apple computers don’t always have the same fonts as Windows machines. Stick to the most common fonts: Arial, Verdana, Helvetica, and Times New Roman. Be careful with any other fonts. There’s one way to make sure that the proper font appears on the user’s screen: List several fonts with commas between them.
The browser will try to use the first font, and if that doesn’t work, it will try the second font, and so on. If you wanted some text to be either Verdana, Arial, or Helvetica, you’d write something like this:
<P STYLE= “font-family: verdana, arial, helvetica,sans-serif;>
(Why did I use sans-serif? Because it’s a basic font that’s installed on every system.)