Difference between revisions of "Cascading Style Sheets"

From Conservapedia
Jump to: navigation, search
(rm w3fools link)
(add a better tutorial)
Line 16: Line 16:
 
==References==
 
==References==
 
* [https://developer.mozilla.org/en/CSS/CSS_Reference A comprehensive CSS Reference at mozilla.org]
 
* [https://developer.mozilla.org/en/CSS/CSS_Reference A comprehensive CSS Reference at mozilla.org]
 +
* [https://developer.mozilla.org/en-US/docs/CSS/Getting_Started A CSS tutorial]
  
 
[[category:internet]]
 
[[category:internet]]

Revision as of 03:23, April 11, 2013

Cascading Style Sheets (CSS) are used with HTML to give a web page designers centralized control over the appearance of each page. CSS rules work best when stored in a stylesheet document, but style rules can also be embedded into a web page (in the header) or used inline (in a tag).

Format

All definitions in CSS are written as

selector {
property: value; 
}

For example, in order to change the background to red, and the text color to maroon, you would type,

body {
background:red;
color:maroon
}
Body is the selector - meaning you want to edit a characteristic of the body in html, background and color are the properties - background refers to the background color and color refers to the text color, and then red and maroon are the given values for those properties.

References