View Full Version : DIV Question.
HabbDance
27-09-2008, 12:34 AM
i've heard that you shouldn't use the same div twice on a web page. i've also heard it doesn't matter.
do you know for sure if it does? :P
if i explained that bad just say, i'm half asleep atm.
har123
27-09-2008, 12:41 AM
You can, only if those divs are the same.
If you have 2 different divs with the same name, they'll probaby go crashing with each other. :P
Jibbish
27-09-2008, 08:45 AM
unless you use classes
Monopoly
27-09-2008, 09:24 AM
Yeah, div ids should only be used once on a page but classes can be used multiple times.
HabbDance
27-09-2008, 11:46 AM
thanks (;
Calon
27-09-2008, 12:44 PM
id = #
class = .
E.g:
.header {
CSS
}
Can be used more than once
#header {
CSS
}
Can't be used more than once ( on the same page )
Excellent2
27-09-2008, 01:00 PM
I got told if you're wanting to use the same div twice it's valid to use classes not id's.
HabbDance
27-09-2008, 01:05 PM
id = #
class = .
E.g:
.header {
CSS
}
Can be used more than once
#header {
CSS
}
Can't be used more than once ( on the same page )
lol. now ya tell me after i changed my whole layout (;
lol jk. thanks anyway.
You can only use the same divs if they are the same.
Like navigations etc, if you want them to look the same, you can use div's twice.
id = #
class = .
E.g:
.header {
CSS
}
Can be used more than once
#header {
CSS
}
Can't be used more than once ( on the same page )
I got told if you're wanting to use the same div twice it's valid to use classes not id's.
both of them are correct. Its alright to use IDs, its just not valid html thats all
The clue is in the name - what would be the point in personal ids if more than one person had the same id, whereas the are loads of different people that are upperclass.
Using ID's more than once will display properly, but it isn't valid when you check the html.
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.