SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Oct 3, 2006, 10:59 #1
- Join Date
- Feb 2003
- Location
- eez
- Posts
- 331
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Should I apply a class or id to body?
Hi!
Should I apply a class or id to body for easy page identification? I heard that there were some bugs for ID. Is that true?
Thanks
-
Oct 3, 2006, 11:08 #2
- Join Date
- Oct 2005
- Location
- London
- Posts
- 1,678
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
hi,
I wouldnt use this at all unless you need to. Why do you need to identify the page in the code? The only time i use it is so i can provide identification in the navigation of a page as to what page the user is currently on.
If you do need to use it though use id because is the only time you're going to use it. Classes are for rules you want to specify more than once.
-
Oct 3, 2006, 23:30 #3
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It doesn't matter. If you use an ID, just make sure that you don't use the same ID for another element on that page.
I normally prefer to use ID for this, because the CSS selector will then automatically get a high specificity and I don't have to worry about some other rule overriding my declarations.Birnam wood is come to Dunsinane
Bookmarks