|
|
DREAMWEAVER CASCADING STYLE SHEETS
Yeah, youve got style, baby. Cascading style. Imaging this: You make a huge site. After countless hours of work, some guy from marketing comes down and says "Um, yeah, weve decided that we think the standard font size should be smaller, and the backgrounds should be light yellow instead of white." How happy are you now? Youll have to tell Mr. Marketing Man that youll need about two weeks to make the changes. On the other hand, if youve used Cascading Style Sheets (CCS) to build your site, you can make all the changes in five minutes and go on vacation for two weeks.
Cascading Style Sheets allow you to stipulate special formatting on a file called a "Style Sheet". After you create the style sheet, you can instruct any desired pages to adopt the style sheets formatting. If you change the style sheet, any pages linked to it will change automatically. Style sheets allow for much tighter control over your text and coloring. You can control the space between words (kerning), the space between lines (leading), and many other options. Using CSS, web designers have they same artistic freedom as traditional print designer. Style sheets also allow for cool HTML functions, like HREF links that glow when you roll over them. In this section of our web design course you're going to learn all kinds of neat stuff.
Redefining HTML TagsAn HTML tag applies specified formatting to text. The <b> tag, for example, makes text bold. The <body> tag specifies that text appear on the screen. What if you wanted all of the text on every page to be a little bigger and dark gray? Wouldnt it be great if you could change what the <body> tag meant? You could stipulate that the <body> tag now makes text appear on the screen and at a certain size. Using CSS, you can do just that. Basically, you can change what each tag means to the browser. You could change the <h1> tagor any other tagto apply formatting more suitable to your taste. Does that rule, or what?
To Redefine Tags in HTML
After you save the new Style sheet in your root folder, the Style Definition box will pop up. This is where you set all the different settings for your text. Choose a category on the left and experiment with different choices on the left. Most of the really useful styles can be found in the "Type" and "Background" categories.
When youre done, hit OK
Assuming that youve got text affected by the tags you redefined, youll see changes!
You can redefine as many tags as you want.
To Edit a Redefined TagYou might want to change the tags redefinitions that you made. Easy enough.
***NOTE: Dont worry about linking this style sheet to other pages yet. Well do that later.
Making Custom StylesMaybe theres a bunch of formatting that you have to apply over and over again. It doesnt really correspond to a certain tag, but your fingers are getting pretty sick of formatting. In the following example, The Question is blue, serif, and large. The answer is red, sans-serif, and small. Q. How much do you like Style Sheets? A. I love style sheets more than life itself.
If you have to format twenty different questions, its going to get old Custom styles allow you to set formatting. You highlight text, and click the style. Presto! Magical formatting.
To Create a Custom Style
To Apply Your Custom Style
The text should assume the style sheet formatting. You can make as many custom styles as you like.
Setting Cool HREF StylesYou can use CSS styles to apply all kinds of effects on links. You can remove the line under links, or change their colors, or make them glow on hover, all kinds of stuff. Make a new CSS Style. Choose "Use CSS Selector".
Selectors to choose from:
a:active Change the way your links look when its
being clicked.
Linking Outside Pages to Your Style SheetYou can link any page in your website to the style sheet you just made. Once its linked, that page will also assume the style sheet formatting. Linking other pages to your style sheet is easy. The best part is that if you edit the style sheet in the future, all of the linked pages will instantly adopt the new changes.
To link your open page to a style sheet:
The style sheets formatting will apply to the current page!
Continue to Templates and Libraries |
|