XHTML and nested divs

Discussion in 'HTML' started by dbunder, Dec 20, 2003.

  1. dbunder

    dbunder Guest

    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
    -----------------------------------------------------------------------
    Posted via http://www.forum4designers.co
    -----------------------------------------------------------------------
    View this thread: http://www.forum4designers.com/message23763.htm
     
    dbunder, Dec 20, 2003
    #1
    1. Advertising

  2. dbunder wrote:
    > 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?
     
    Leif K-Brooks, Dec 20, 2003
    #2
    1. Advertising

  3. dbunder

    John McGaw Guest

    "dbunder" <4designers.com> wrote in message
    news:4designers.com...
    >
    > 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
    > ------------------------------------------------------------------------
    > Posted via http://www.forum4designers.com
    > ------------------------------------------------------------------------
    > View this thread: http://www.forum4designers.com/message23763.html
    >

    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
     
    John McGaw, Dec 20, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guadala Harry

    Nested DIVs - is there a better way?

    Guadala Harry, Oct 26, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    505
    Guadala Harry
    Oct 26, 2004
  2. Bernd Liebermann

    nested divs - newbie question

    Bernd Liebermann, Dec 17, 2004, in forum: HTML
    Replies:
    2
    Views:
    429
    Travis Newbury
    Dec 17, 2004
  3. Jens Lenge

    'clear' inside of nested divs

    Jens Lenge, Mar 10, 2005, in forum: HTML
    Replies:
    22
    Views:
    1,256
    Jens Lenge
    Mar 15, 2005
  4. rich
    Replies:
    0
    Views:
    756
  5. maya
    Replies:
    4
    Views:
    265
Loading...

Share This Page