GetDotted Domains

Viewing Thread:
"Difference between CLASS and ID ... ?"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Thu 15/05/03 at 12:08
Regular
Posts: 787
I recently decided to try and learn how to use cascading style sheets properly (emphasis on the "try") and so I threw myself into it, reading up on stuff from w3.org as I went along. So far it's going okay with all the usual hiccups and learning curves.

One thing confuses me, however: what's the difference between CLASS and ID? This may be obvious to a seasoned programmer but I'm new to this and I'm confused. If possible could someone explain when I should use CLASS and when I should us ID and, please, don't get *too* technical otherwise I'll get lost!

Thanks in advance.
Thu 15/05/03 at 12:26
Regular
"Twenty quid."
Posts: 11,452
Thanks - that's really helped!

Now I'm off to remove all traces of tables from my website ...
Thu 15/05/03 at 12:16
Regular
"It goes so quickly"
Posts: 4,083
ID is like name .. it gives a particular element an identity.

Class is a set of properties you can give to any element.

You can use the same class in as many elements as you like, whereas Id's have to be unique for each element.



#anID {
properties go here
}

.aClass {
properties go here
}




Page Content

--- 'anID' can only be called on once.




Page Content



Page Content




a link


--- 'aClass' can be called on may times.
Thu 15/05/03 at 12:08
Regular
"Twenty quid."
Posts: 11,452
I recently decided to try and learn how to use cascading style sheets properly (emphasis on the "try") and so I threw myself into it, reading up on stuff from w3.org as I went along. So far it's going okay with all the usual hiccups and learning curves.

One thing confuses me, however: what's the difference between CLASS and ID? This may be obvious to a seasoned programmer but I'm new to this and I'm confused. If possible could someone explain when I should use CLASS and when I should us ID and, please, don't get *too* technical otherwise I'll get lost!

Thanks in advance.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

First Class!
I feel that your service on this occasion was absolutely first class - a model of excellence. After this, I hope to stay with Freeola for a long time!
Impressive control panel
I have to say that I'm impressed with the features available having logged on... Loads of info - excellent.
Phil

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.