LILLYROBOT.COM |
Cascading style sheets separates the content (HTML) from the design. It allows you to have more control on how your web pages are displayed. With CSS you can control the style and layout of multiple web pages.
CSS was developed by W3C (http://www.w3.org/Style/CSS).
A style sheet contains an open tag <style> and a close tag </style>.
A selector defines the HTML element. The declaration has curly braces and within the braces you have the property followed by a colon and a value. Each declaration ends with a semi-colon.
selector {property: value;}
You can have more than one declaration within the braces separated by a semi-colon.
An internal style sheet is on the same page as the html codes. The <style> </style> tags are placed inside the <head> </head> tags. Everything you want to display on the website goes inside the <body> </body> tags.
Displays
This text is in blue
An external style sheet is a document which contains nothing but css codes. The document must be saved with a file name followed by the extension .css instead of .html.
It is best to use an external style sheet if you have multiple pages with the same codes. You can have more than one external sheet as long as they have different names.
<link rel="stylesheet" type="text/css" href="nameOfYourDocument.css"/>
</head>The inline style codes go inside the html element.
Displays
This text is green
Displays
This text is red and bold