WordPress.org

Ready to get started?Download WordPress

Forums

Simple Problem with Borders (Simpler Version) (4 posts)

  1. ptrinh
    Member
    Posted 8 years ago #

    Here is a very simple problem:

    I need a large container, width: 900 px, that will envelope my blog. Inside this large container is a header, floated at the top. Below the header is a smaller container.

    Index file looks like this:
    <div id = "bigcontainer">
    // Generate the header
    <div id = "smallercontainer">
    //Generate the post
    </div>
    </div>

    The style sheet has this:
    #largecontainer
    {
    width:900px;
    margin:0 auto;
    padding:0px 3px;
    border: thick solid #FF0000;
    }
    #smallercontainer {
    position:absolute;
    top: 194px;
    overflow: hidden;
    display:inline;
    }

    Here is the simple problem. When the above is generated, I get a big red border, but ONLY around the header file. When smaller container is not positioned absolutely (the line is removed), then the red border surrounds everything. Why is this happening? Why does my big container not contain the little container?

  2. Medizinische Abkuerzungen
    Member
    Posted 8 years ago #

    If you use a position-tag in a div it will be positioned relative or absolute to the parent, but not inside the parent-div.

  3. katesgasis
    Member
    Posted 8 years ago #

    try putting position:relative; in the #largecontainer

  4. Medizinische Abkuerzungen
    Member
    Posted 8 years ago #

    relative will display a border around the largecontainer. But around the largecontainer in the old position (before moving it down to position 194

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.