Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6737301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:13:58+00:00 2026-05-26T11:13:58+00:00

I am trying to get a single column layout to work. The page has

  • 0

I am trying to get a single column layout to work. The page has three sections, a header area, a content area, and a footer area. Each of the sections have different background images that I want to span the entire width of the viewable area on user’s screens. I have split the sections into divs as shown in the following code so that the content area in the middle can grow as the content grows.

My problem is that as I increase the size of the text by pressing ctrl + in the browser (Chrome), the carousel portion overflows the background area. Given below are screenshots of before and after resizing.

The HTML/CSS code mockup is simple, but I am not able to figure out why the overflow happens. Any ideas? I am a newcomer to CSS/XHTML – are there any other standard ways of achieving what I am trying to accomplish?

Before resizing

After resizing

<html>
<head>
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>

<div id="header_container">
    <div id="header">
        Header text
    </div>
</div>

<div id="content_container">
    <div id="content">
        The content

        <div id="carousel">
        The carousel
        </div>

        <div id="clear_div">
        </div>
    </div>
</div>

<div id="footer_container">
    <div id="footer">
        The footer
    </div>
</div>

</body>
</html>

Here is the CSS for the HTML:

#header_container {
    width: 100%;
    background-color: green;
}

#header {
    width: 960px;
    margin: auto;
}

#content_container {
    width: 100%;
    background-color: lightblue;
}

#content {
    width: 960px;
    margin: auto;
    position: relative;
}

#carousel {
    float: right;
    width: 300px;
    height: 200px;
    background-color: red;
}

#clear_div {
    clear: both;
}

#footer_container {
    width: 100%;
    background-color: lightgray;
    clear: both;
}

#footer {
    width: 960px;
    margin: auto;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:13:59+00:00Added an answer on May 26, 2026 at 11:13 am

    The problem is that “width: 100%;” of #content_container (blue background) is computed not from actual content width, but from browser window width. So the moment then window width become less than #content width (fixed at 960px), #content starting to came out from background.

    Example:

    1. You browser window width is 500px.
    2. #content_container, #header_container and #footer_container “width: 100%” also become 500px.
    3. #content width = 960px, which is 440px more than #content_container width.
    4. So right side of #content come out from #content_container for 440px.

    Then you increase size in browser same thing happens (#content width become more than #content_container width).

    You can fix it, for example, by adding property “min-width: 960px;” to #content_container, #header_container and #footer_container so they will be always same width or more.

    EDIT: See live example with min-width: http://jsfiddle.net/Xqtuh/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get a column result in a single row. Is it possible
I'm trying to get the offset or position of the cursor on a single
Trying to get this to work, with no luck: [DataMember] public Type ParameterType {
Trying to get a JSON output to work with jqGrid 'userdata' option. The example
I am trying to get Linq2SQL to work with my legacy database. I currently
I am trying to get the number of page opens on a per day
I'm trying to get a single field back from the data. (I am searching
I'm trying to get the count of documents within 4 specific sections using the
I have a datatable where one column is a float (a system.single). I'm trying
I'm trying get values from a GridView using the following code: foreach (GridViewRow row

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.