If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
CSS represents an acronym for ‘Cascading Style Sheets’. And for those who are using it CSS is a an extension of HTML who allow you to style your web page. We can start by making a simple example of style changes to make words bold. In HTML you would use <b> like :
<b>Strong bold</b>
It is a very easy task, and works just fine, and is nothing bad with it. Though that if you want to change all the text that you bold it, you have to go to every spot in the page and change the tag.
One negative aspect that we have found is that : If you want to make the text bold and add a fond style, whatever you would have to add a big code around the text:
<font color=”#FF0000″ face=”Comic Sans MS, Arial, Helvetica, sans-serif”><strong>This is text</strong></font>
And now slowly HTML starts to get hard and nasty. CSS helps you to create a custom style elsewhere and add all the properties, add a name, and after apply the properties in HTML :
<p class=”SomeStyle”>Some CSS styled text</p>
Add between the <head></head> tags the CSS code that will define the style :
<style type=”text/css”>
<!–
.SomeStyle {
font-family: Comic Sans MS, Arial, Helvetica, sans-serif;
font-weight: bold;
color: #FF0000;
}
–>
</style>
The text above is a complete CSS code that can be inserted in the page directly. For projects that don’t have big situations, this is perfect to use, because the style is in a single page. It can be a ‘problem’ to copy-paste the code when you have more pages, and you have to use it severltimes.
If you want to make better you will have to restyle each page. Like with JavaScript you can define and create your CSS style in a notepad and then link it where you want to apply the code :
<link href=”StyleSheet.css” rel=”stylesheet” type=”text/css”>
The previos code links to the HTML code. Place the code between the <head></head> tags in your web pages.
