Selectors are the names that you give to your different styles.
In the style definition you define how each selector should work (font, color etc.).
Then, in the body of your pages, you refer to these selectors to activate the styles.
For example:
<HTML> <HEAD> <style type="text/css"> B.headline {color:red; font-size:22px; font-family:arial; text-decoration:underline} </style>
</HEAD>
<BODY> <b>This is normal bold</b><br> <b class="headline">This is headline style bold</b> </BODY>
</HTML> |
|
In this case B.headline is the selector.
The above example would result in this output:
This is normal bold This is headline style bold |
|
There are three types of selectors:
HTML selectors Used to define styles associated to HTML tags. (A way to redefine the look of tags)
Class selectors Used to define styles that can be used without redefining plain HTML tags.
ID selectors Used to define styles relating to objects with a unique ID (most often layers)
|
|
|
No comments:
Post a Comment