
CSS Tutorial
CSS Tutorial.
Let's start with the basics.
What is CSS? CSS is Cascading Style Sheets. This is a series of instructions, kept in a file on the web server which send formatting instructions to the client browser.
The main point of using CSS is to keep your website presentation elements seperate from your business and presentation logic. This modularization allows for greater flexibility and control over the design element. Someone can make a change to the design, and it will not affect the rest of the website.
CSS also helps set a consistent rule set on your HTML elements, referenced from one page for simplicity. You can control any normal HTML from your stylesheet. This is a much better solution that ones used in the past that involved multiple files scattered across your website.
This file is linked in by using the STYLE command of HTML. If you don't want to use the STYLE command you can use link href and set the path to the CSS file. This is my preferred method.
Basics of using Cascading Style Sheets
Each of the style rules is made up of a selector which generally corresponds to the basic HTML Elements such as P, H1, BODY and the like. Each style rule follows a similar format:
selector { property: value }
Multiple properties are seperated by a semi-colon. Here is a real world example:
color: #0000FF; font-family: Arial, Helvetica, sans-serif; font-size: 17px; PADDING-RIGHT: 15px; PADDING-LEFT: 15px; PADDING-BOTTOM: 15px; MARGIN: 0px; PADDING-TOP: 15px
Now anytime you call the H1 style element from your HTML document, the formatting included in this rule will be applied. If your file is included in every page of your website, than a simple change to this style sheet will affect all of the pages simultaneously. You can easily imagine how this could be a great bonus to you.