Question about the symbols in CSS
-
Greets:
Silly question about CSS. I’m looking at a CSS file and am wondering when you use the # marks, when you use the periods and when you don’t use anything at all in front of the lines.
Thanks,
-drmikeTold you I didn’t know anything about CSS :)
-
# = id
An id can only be used once.. = class
You can use classes as often as you need and in different ways[blank] = just a regular declaration
—
#box {-details-}
<div id=”box”>
You can only have one such box used once on a page.
</div>.text2 {-details-}
<div class=”text2″>This could be used here</div>
then we have some other text
<div class=”text2″>and we use that styling again here</div>h3 {font-size: 10px;}
.bigger {font-size: 20px;}
—
You can mix though ..<h3>This will be 10px tall</h3>
<h3 class=”bigger”>and this would be 20px</h3>or you could have
.red {color:#ff0000;}
.green {color:#00ff00;}
.blue {color:#0000ff;}
and then do
<p class=”red”> Have some red <p class=”blue”> and some blue etc… -
-
- The topic ‘Question about the symbols in CSS’ is closed to new replies.