Quote
div class and div id!
Whether you're a seasoned veteran or a struggling beginner, Web Radiance is the web development and web design forum for you. You'll find answers to all your HTML, CSS, SEO, and Programming needs. Pull up a chair and stay awhile.
div class and div id!
#21
Posted 07 January 2007 - 08:52 PM
#22
Posted 08 January 2007 - 05:36 AM
Considering how the topic was getting quite lengthy, I thought this might be wise for when somebody else finds it!
#23
Posted 29 January 2007 - 04:53 AM
eg :
.content h1
.content h2
Normally I would use DIVs to do this, eg :
#content h1
#content h2
If so, then is it bad for me to be using more than one instance of a DIV within a page?
I have a text box that I would like to use multiple times around the page, and it needs to use different styles for a and a:hover within this text box etc, but from my understanding this cannot be done with a class...
#24
Posted 29 January 2007 - 08:09 AM
wgardner, on Jan 29 2007, 04:53 AM, said:
eg :
.content h1
.content h2
Actually, you'd be wrong; you can very nicely use that selector.
wgardner, on Jan 29 2007, 04:53 AM, said:
#content h1
#content h2
If so, then is it bad for me to be using more than one instance of a DIV within a page?
It is only bad to use multiple instances of a div, on the same page, if that div has an ID. If you could give it a class, instead, then you're ok.
wgardner, on Jan 29 2007, 04:53 AM, said:
I do believe, if I understand you correctly, this is a case for multiple attributes, like so:
CSS:
.textBox {property:value;}
#commentTextBox {property:value;}
#formTextBox {property:value;}
xhtml:
<div class="textBox">...content...</div> <div class="textBox" id="commentTextBox">...content...</div> <div class="textBox" id="formTextBox">...content...</div>
This will allow you to specify common styles that all of these boxes need to have, via the class "textBox", and then separately, individual styles each box needs to have, via their respective ids.
#25
Posted 29 January 2007 - 08:39 PM
sypher, on Jan 7 2007, 08:52 PM, said:
It has not be depreciated for the input elements, but it has for the form element itself. [As well as, a, applet, frame, iframe, img, and map. cite: http://www.w3.org/TR/xhtml1/#h-4.10]
#26
Posted 30 January 2007 - 04:51 AM
#27
Posted 30 January 2007 - 06:11 AM
#28
Posted 30 January 2007 - 08:23 AM
Ryan Fait, on Jan 30 2007, 04:51 AM, said:
Well, I see your point, and I'm sure I'm just being nit-picky in saying this, but using IDs for a singular element on a document is just semantically correct.
It would be like going to college and being handed a class card instead of an ID card; there truly is only one Ryan Fait in that school, but what the heck, the administration thought it best to put you in your own class of people... all by yourself.
For the second time today, {runs and hides}
#29
Posted 30 January 2007 - 10:26 PM
This post has been edited by Ryan Fait: 30 January 2007 - 10:27 PM
#30
#31
Posted 24 September 2011 - 01:14 PM


Help


MultiQuote













