Saturday, September 1, 2012

CSS quick cheat sheet/tutorial

I think it is about time I start building a cheat sheet for myself. Here is a CSS one to cover up all the basics.

How to use a CSS from another file:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>

Elements and definition
SELECTOR { PROPERTY: VALUE; PROPERTY:VALUE;}
h1 { Color: BLUE; fontsize:12px;}

Comments:
/*This is how you comment*/

how to apply the style:
in the html line, use style="Color:Blue"

how to write a CSS
something
{
font-Size: 24px;
}

how write a CSS to apply it to what
. means  class selector for multiple elements  e.g. .RegisterElements. Or you can get p.RegisterElements

# means selects an id  e.g.  id="item"