CSS is the acronym for: ‘Cascading Style Sheets’. CSS is an extension to basic HTML that allows you to style your web pages. An example of a style change would be to make words bold. In standard HTML you would use the <b> tag like so:
<b>make me bold</b>
This works fine and there is nothing wrong with it per se except that now if you wanted to say change all you text that you initially made bold to underlined, you would have to go to every spot in the page and change the tag.
Another disadvantage can be found in this example: say you wanted to make the above text bold, make the font style Verdanna and change its color to red you would need a lot of code wrapped around the text:
<font color="#FF0000" face="Verdana, Arial, Helvetica, sans-serif"><strong>This is text</strong></font>
This is verbose and contributes to making you HTML messy. With CSS you can create a custom style elsewhere and set all its properties, give it a unique name and then ‘tag’ your HTML to apply these stylistic properties:
<p class="myNewStyle">My CSS styled text</p>
And in between the <head></head> tags at the top of your web page you would insert this CSS code that defines the style we just applied:
<style type="text/css">
<!--
.myNewStyle {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
color: #FF0000;
}
-->
</style>
The complete version of the tutorial can be found here

LinkBack URL
About LinkBacks





Bookmarks