CSS/Basic Code
From r00tedvw.com wiki
(Difference between revisions)
Line 24: | Line 24: | ||
Allows you to create specific groups that you can then apply styling to, very granular | Allows you to create specific groups that you can then apply styling to, very granular | ||
<nowiki>ie. | <nowiki>ie. | ||
+ | HTML | ||
<p id="intro">Introduction</p> | <p id="intro">Introduction</p> | ||
you can then use CSS to only apply styling to this specific ID: | you can then use CSS to only apply styling to this specific ID: | ||
+ | CSS | ||
#intro{ | #intro{ | ||
color: red; | color: red; | ||
} | } | ||
and | and | ||
+ | HTML | ||
<li class="list_item">Bullet</li> | <li class="list_item">Bullet</li> | ||
+ | CSS | ||
.list_item{ | .list_item{ | ||
color: red; | color: red; | ||
} | } |
Revision as of 13:44, 10 November 2013
Link - defines the css page to include for formatting the page
<link type="text/css" rel="stylesheet" href="stylesheet.css"/> type=text/css -- defines the type of file rel=stylesheet -- same as above href= -- points to the location
General Format for most CSS
selector { property: primary value, backup value; property: primary value, backup value; }
Example:
sets all paragraphs to the color of red p{ color: red; }
Comment
/*I'm a comment!*/
Built in default fonts for CSS
serif sans-serif cursive
Classes & IDs
Allows you to create specific groups that you can then apply styling to, very granular
ie. HTML <p id="intro">Introduction</p> you can then use CSS to only apply styling to this specific ID: CSS #intro{ color: red; } and HTML <li class="list_item">Bullet</li> CSS .list_item{ color: red; }