SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Combining Menu, Content, and right menu into one div?

    I want to know which is more efficient.

    I have a left menu, a content area in the middle, and then a small column on the right. I want all of these to be on the same level (meaning the tops)

    Here is what I currently have.

    Code:
    <div id="container">
    <div id="header"><img src="images/seemac_01.jpg" width="270" height="114" alt="Seemac Incorporated Logo" class="floatleft" /><img src="images/seemac_04.jpg" width="310" height="156" alt="Logs" class="floatright" /></div>
    <div id="left-menu">
    <ul>
    <li>Home</li>
    <li>Products</li>
    <li>Services</li>
    <li>History</li>
    <li>Legacy</li>
    <li>Contact</li>
    </ul>
    </div>
    <div id="news">News</div>
    <div id="content">Content</div>
    <div id="footer">footer: Seemac 2003</div>
    </div>
    Now, am I better off including <div id="left-menu>, <div id="news">, and <div id="content"> all into one container themselves, and then just applying a top margin to the container, or should I leave it how I have it?

    Thanks
    Bryan

  2. #2
    SitePoint Member
    Join Date
    Oct 2003
    Location
    desert
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.glish.com/css/7.asp

    the way you see it done there is pretty good (i believe its how you already implemented it)

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,276
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Now, am I better off including <div id="left-menu>, <div id="news">, and <div id="content"> all into one container themselves, and then just applying a top margin to the container, or should I leave it how I have it?
    Hi, I think it all depends on the situation and what you want to achieve. As a rule of thumb it's better to avoid nesting if you don't have to but if on the other hand it makes for less code then it's probably worth it.

    If you just want to apply the same top margin to all three then less code would be.
    Code:
    #left-menu, #content, #news {margin-top:50px;}
    Paul

  4. #4
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys, good pointers.

    Bryan


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
  •