Is it possible to have multiple styles in one *.css stylesheet?
If so, how do you differentiate between the two?
If not, how do I instruct the two webpage elements that I want to be styled differently to refer to which stylesheet?
Dumb CSS question
-
- Posts: 200
- Joined: Fri 02 Jan, 2004 09.45
Certainly:
#black{color:#000000}
#white{color:#ffffff}
<.span id="black">This text is black<./span>
<.span id="white">This text is white<./span>
#black{color:#000000}
#white{color:#ffffff}
<.span id="black">This text is black<./span>
<.span id="white">This text is white<./span>
-
- Posts: 200
- Joined: Fri 02 Jan, 2004 09.45
span, div, p, td... any of them would work.
To be compliant, you should use classes instead of IDs where you'd repeat use of the same ID.
example:
The above would function if you chose to use IDs, but wouldn't validate successfully.
example:
Code: Select all
.SmallFont{font-size:10px;}
.LargeFont{font-size:15px;}
<span class="SmallFont">This would be at 10px</span>
<span class="LargeFont">This would be at 15px</span>
<span class="SmallFont">This would be at 10px again</span>