XHTML and nested divs

D

dbunder

I'm currently designing a site and I want to conform of XHTML standard
(transitional). On a few parts of my site I need to use nested di
tags. XHTML does not allow this for some reason. Is there another wa
I could write something like

<div class="content"> <!--container tag-->
<div class="contentheader"><!--header tag with border-->
a header
</div>
</div>

I've not kept up with HTML or stylesheets for the past few years so I'
kinda rusty. Thanks for any help

dbunde
 
L

Leif K-Brooks

dbunder said:
I'm currently designing a site and I want to conform of XHTML standards
(transitional). On a few parts of my site I need to use nested div
tags. XHTML does not allow this for some reason. Is there another way
I could write something like

<div class="content"> <!--container tag-->
<div class="contentheader"><!--header tag with border-->
a header
</div>
</div>

That should be perfectly valid (although the div.content header should
probably be a <h#>). There's probably something else on the page that's
invalid, URL?
 
J

John McGaw

dbunder said:
I'm currently designing a site and I want to conform of XHTML standards
(transitional). On a few parts of my site I need to use nested div
tags. XHTML does not allow this for some reason. Is there another way
I could write something like

<div class="content"> <!--container tag-->
<div class="contentheader"><!--header tag with border-->
a header
</div>
</div>

I've not kept up with HTML or stylesheets for the past few years so I'm
kinda rusty. Thanks for any help!


dbunder
Don't know what your problem is but nested DIVs are perfectly legal. I just
got done changing my old site over to XHTML 1.1, which is by default strict
and has no relaxed standards. Every page is chock full of nested DIVs,
usually two deep but sometimes three or more from what I remember, and it
W3C certifies just fine Can't claim that it is a work of art but it even
works fine and looks about the same in every modern browser I have access
to.
--
John McGaw
[Knoxville, TN, USA]

Return address will not work. Please
reply in group or through my website:
http://johnmcgaw.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top