CSS: ID as selector


You can define a key (ID) to identify a specific class, in order to apply it to a specific tag. In other words, if you want to use a specific class to define a specific tag - and just that tag - you can define a key. So you can use your ID wherever you want to use it. It will affect only tags where you use it. Take a look to this example:

<head><style type="text/css>p { color : red }
#myidxyz { color : blue }</style></head>

<body><p>This line is red, because all <p> tags have to be red</p>

<p id=myidxyz> However this line isn't red, because I'm using a specific ID to define this tag's features and only this tag's features. So, this line will be blue</p>

myidxyz is your key. But you can name your ID as you prefer. For example you could name your ID so: #mybluecolorid.


Index           Home  Back       About  Contact us!

Copyright (c) 1998-2006 Wowarea