Results 1 to 4 of 4

Thread: Nested DIV tags questions

  1. #1
    Join Date
    May 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Nested DIV tags questions

    I have a rudimentary question regarding nested DIV tags. If I have document setup like below and have Table elements set in both ID sectors Main and Content which ID Sector will prevail? Shouldn't the last ID Sector stated prevail?

    HTML Code:
    <body>
    <div id=main>
       <div id=content>
    
    
       </div>
    </div>
    </body>
    Thanks,
    Wayne

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by wgregori View Post
    I have a rudimentary question regarding nested DIV tags. If I have document setup like below and have Table elements set in both ID sectors Main and Content which ID Sector will prevail? Shouldn't the last ID Sector stated prevail?
    Your question isn't clear to me. The phrase "ID sector" doesn't have any technical meaning, so I don't know to what you're referring. Moreover, in what sense are these "sectors" supposed to prevail over one another?

    Mike
    Last edited by mwinter; 05-07-2007 at 02:05 PM. Reason: Horrid grammatical mistake

  3. #3
    Join Date
    May 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Okay,

    I've got my DIV ID=main where I have set some table parameters but further down my document I'd like to change those table parameters. I thought that I could just set up another DIV tag (ID=content) change my table parameters and have the tables that are between that DIV ID=content take on those new attributes.

    HTML Code:
    <body>
    <div id=main>
    
       <div id=content>
    
    
       </div>
    </div>
    </body>

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You should be able to:

    Code:
    #main table {
    border:1px solid black;
    }
    
    #content table {
    border:5px dashed red;
    }
    yes. But if it were like so:

    Code:
    #main table {
    border:1px solid black;
    }
    
    #content table {
    font-weight:bold;
    }
    Tables in the content division would still inherit the 1px solid black border from being also in the main division.

    CSS stands for cascading style sheets. That means, unless contradicted, the styles cascade throughout the document.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •