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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:19:43+00:00 2026-06-16T18:19:43+00:00

I have a main container div, and I’d like it to be margined from

  • 0

I have a main container div, and I’d like it to be margined from the top of the screen exactly, for example, 10% of the screen width. This way I won’t have problems with non-uniform screen sizes etc..

I already found a dirty workaround which is putting a 1px by 1px image of the color of the background, right before the div, and then style it to have 10% of the width of the screen. But this looks quite dirty, doesn’t it? Is there any better solution?

  • 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-06-16T18:19:44+00:00Added an answer on June 16, 2026 at 6:19 pm

    The solution I find very elegant is to insert the page in a table, beginning right after the body, and terminating right before it.

    You’d have this:

    <html>
    <head><title>...</title></head>
    <body>
    <table id="content"><tr><td>
    
        Your whole page comes here...
    
    </td></tr></table>
    </body>
    </html>
    

    Now simply decide the size of the page, using the style:

    #content {
    
        width: 850px;
        margin-left: auto;
        margin-right: auto;
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a main container div such as: <div id=ourCustomers style=height:300px;float:right;width:480px;> <div id=topOurCust style=height:150px;width:480px;>
I have a main container div in the center of my webpage. This is
i have inside the body main 'container' div and inside this 'container' div there
I tried to center my div using margin: auto like this: #main-container #control-panel {margin:
Basically, I have a main container div with nested content. This div is has
Description: I have a page, with a container (div.display). The div for the main
I have the following html: <div class=main> <div class=container> <h4 class=test> Test </h4> </div>
I have a main container <div> which holds 4 or 5 other sub <div>
I have a #main div nested within a container div that I want to
I have div container with width 100%. I need to make a content hide

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.