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 7570675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:29:07+00:00 2026-05-30T15:29:07+00:00

In my site design, I need to have a div centered on the page

  • 0

In my site design, I need to have a div centered on the page 1280 pixels wide.

The content within the div will be centered and 960px wide to accomodate most browser sizes.

I need the extra width on the outer div to have hidden overflow on the left/right sides evenly so that the div spills outside the viewing window as the browser is resized/gets smaller.

The layout is currently similar to this:

<div> //outer div: width 100%
  <div> //inner div: width 1280 pixels wide with background
    <div> //centered content: 960px wide

    </div>
 </div>

enter image description here

In the image above, the darker blue is 1280px wide. The lighter blue is 960px wide, centered on page.

I need the darker blue to overflow(hidden) off of both sides of the screen when the browser is resized..eventually leaving only the lighter blue centered before a horizontal scroll bar appears.

Any ideas?

EDIT

My current problem is that the outer 1280px div will not overflow properly causing the center div to come off of center.

Fiddle

http://jsfiddle.net/tKtwg/1/

In the fiddle above, you can see that the outer div does not overflow evenly when you decrease the window size.
Edit 2
What I want to avoid is the horizontal scroll bar appearing until the 960 wide div is reached. Sorry I should have been more clear

  • 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-30T15:29:08+00:00Added an answer on May 30, 2026 at 3:29 pm
    body
    {
        background-color: #00a2e8;
        width: 100%;
    }
    
    
    .content
    {   
        background-color: #99d9ea;
        width: 960px;
        margin: 0 auto; 
        min-height: 1000px
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating an ASP.NET site where some pages need to have a div floated
I have a html file has the general design (some div's) and I need
I have implemented a GoogleMapsV3 map in a twitterBootstrap basic responsive design site. But
How to design a Web Site that will fit to Mobile and Desktop both,
Information: I have a site that has a design on index.php, and then you
I'm setting up a Magento site and have some design requirements that we can't
Is there a specific design practice for MVC type sites that need to have
I have to create a web site for a design company. Client's requirements are
I have a legacy database with a pretty evil design that I need to
I need to design an Islamic Prayer Time Widget using ASP.Net, C#. I have

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.