-
suc-css
The CSS I was copying to learn was confusing me, so I sat down again and using this site:
http://www.wellesley.edu/Computing/Dreamweaver/CSS/cssRules.html
clarified a few good things.
CSS code has 3 parts: the selector , the property and the value.
for e.g.h1 { font: arial }
h1 is the selector - i.e. what will be selected in the HTML by the CSSfont is the property - what property you want to change
arial is the value - what value you want the property to be
Okay now so there are 3 ways you can select a part of the HTML.- html selectors h1 is an example of using an . In order to activate this CSS in the HTML you just need to tag something <h1> </h1>
- class selectors are another way, which are more flexible because you can effectively tag anything - not just something the browser recognizes like h1 or p. The way you write the CSS code with a class selector is: .selector_name {etc}. Then to activate it in the HTML you just need to tag something <property (e.g. h2) class=”selector_name”> </h2>
- Id selectors which are very similar to class selectors except you put # instead of the . in the css code, i.e. # id selector name. And then to activate it in the HTML you just give the property an id, e.g. <h3 id=”id selector name”> </h3>
that ‘s all for me
Posted on March 22, 2009
blog comments powered by Disqus