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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:48:29+00:00 2026-05-25T06:48:29+00:00

How do I center my page content so it is centered on every type

  • 0

How do I center my page content so it is centered on every type of screen size? For instance, on Allegorithmic if I resize my browser, the center content will shift to the left until it reaches the browser window. There are certain background elements that extend horizontally infinitely (the dark gray at the top, the light grey in the middle, etc.). I can open this website on my laptop and on my iMac and it is centered. I thought I might use absolute positioning to move content x amount of pixels from the left, but that won’t work because 300 pixels that center the content on a small screen, won’t center it on a large screen.

So in essence I would like to duplicate the functionality of the Allegorithmic website, have backgrounds that are infinite horizontally, but have certain content that always stays “centered”.

  • 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-25T06:48:29+00:00Added an answer on May 25, 2026 at 6:48 am

    If you want elements always centered use margin: 0 auto; in the styles on it.

    #yourElement{
        margin: 0 auto;
    } 
    

    W3.org reference for centering things using CSS

    To get background elements to extend the whole page length just give them a width of 100%, then make a child container within and give them the same style as above. I bet the example you gave is just using a 1px by some height with lines to get that look on the background.

    Example

    Example with image bg

    Markup

    <div id="background">
        <div id="content">
        </div>
    </div>
    

    CSS

    #background{ 
        width: 100%;
    }
    #content{  
        width: 960px;
        margin: 0 auto;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how can i set div position at the center of the page with size,
I have a DIV in the center of my page which has margin-left and
I want to create a page with a horizontal centered content block that reaches
I have a problem with the page heading to be left-center of background irrespective
How do I center align 3 floating divs inside each other centered on page
I want my page to always be centered in the browser without affecting the
I'm trying to create a centered, page container that will vertically stretch across the
I'm trying to center a page on any resolution while still being able to
I am attempting to center my entire page using only CSS and it is
I'd like to center an image in a page both vertically and horizontally even

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.