Need help? Check out our Support site, then


SandBox-10 Container vs Content?

  1. I'm definitely a newcomer to CSS so I apologize in advance if this sounds silly.

    I'm designing a new layout using Sandbox-10 and I'm trying to understand the relationship between the container and content divs. It seems to be redundant. The content div is inside the container but nothing else is in the container except what's inside the content div.

    <div id="container">
    <div id="content">
    stuff
    </div>
    </div>

    I know I must be missing something but I don't know what.

    Thanks in advance for any help!

  2. That's a good question. I'll try to explain the best I can why, IMO, it's there.

    The way I see it, the "container" allows you to, well... contain the contents element, and makes it easy for you to manipulate the "content"'s relative position when dealing with a 3 column layout; otherwise, the sidebars would overlap with your contents area.

    Since the sidebars are at the bottom of the contents, you need to manipulate their position by playing with their floats and margins. If you didn't have the "container", you wouldn't be able to give a left margin to your contents element wide enough to "hold" your "primary" sidebar, otherwise like I said before, your elements would overlap and look messy.

    One of my 3 column skins is coded this way, feel free to study its code (and play with it, if you wish) to have a better understanding on how this works.

    I hope this explanation helps.

  3. Thanks! This is very helpful. I looked at your code and that helps explain a lot. Nice skin btw.

  4. Sure thing!

  5. P.S. I came across a previous post of yours devblog in which you gave code for a basic 3-column setup.

    http://en.forums.wordpress.com/topic/3-columns-with-sidebars-to-the-right?replies=15#post-281602

    I found this very helpful too and simpler.

  6. No problem.

    I don't know if you'll read this but.... Your gravatar looked familiar and after checking your current blog, I remembered where I 'saw' you before. In another thread, I gave you some code to fix your post dates issue. That's another good example of why "container" is necessary/helpful.

Topic Closed

This topic has been closed to new replies.

About this Topic