![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
* Elements with an ID can be used as "named anchors", e.g. h1 id="top">main heading</h1 ... ... a href="#top">back to top</a |
|
.oO(Kitty) I am getting a headache trying to understand the true difference and an example to see the difference between Classes and Ids. |
#3
| ||||
| ||||
|
|
I am getting a headache trying to understand the true difference and an example to see the difference between Classes and Ids. I have been to several websites and they explain it in a very bland way. They even went so far as to say that it is true "what is the use of IDs when you've got Classes that do the same thing". |
|
What exactly does this mean below? "As just noted, the syntax for the ID selector is much like that for the class selector. Again there are two kinds of selector, those associated with a particular type of element, and the more general selector that can apply to any element with an ID that matches the ID of the selector. |
|
.bluetxt {color: blue} #bluetxt (color: blue) p class="bluetxt">text</p p id="bluetxt">text</p Gives the same outcome - I don't understand!!! |
|
Are there people that use classes for one reason and IDs for another to cut down on confusion of different sections or color themes - there has to be a method to the madness. |
![]() |
| Thread Tools | |
| Display Modes | |
| |