CSS Notes


Class separates one CSS set from another.

for example:


p: {fontsize: 100%;}

p.halffont {fontsize: 50%;}


In the CSS, a class selector is a name preceded by a full stop (.) and an ID selector is a name preceded by a hash character (#).

The HTML refers to the CSS by using the attributes id and class.

You can also apply a selector to a specific HTML element by simply stating the HTML selector first, so p.hereiam { whatever } will only be applied to paragraph elements that have the class 'hereiam'.

<p>Normal 100 percent text</p>
<p class = "halffont">Half size text<p>

#Layout p {
 	margin: 10px 5px 5px 0;


ID's are used to format one specific thing and are only supposed to be referenced once within a web page.

#Footer { 
 	clear: both;  
	width: 800px; 
	height: 5em; 
	background: transparent url(../images/footerBottom.gif) no-repeat bottom left; 
	text-align: center; 
	#Footer .footerTop {
		width: 100%;
		background: transparent url(../images/footerTop.gif) no-repeat top left;
		display: block;
		height: 2em;
  	#Footer p { 
		color: #fff;
		font-size: 1.1em;
		text-align: center;
		margin-top: -0.6em;
  	#Footer a { 
	   	color: #fff; 
	   	text-decoration: none;
	#Footer a:hover {
		color: #fff;
		text-decoration: underline;