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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:08:08+00:00 2026-05-27T03:08:08+00:00

I have a fixed size layout, centered using margin: 0 auto . I wonder

  • 0

I have a fixed size layout, centered using margin: 0 auto. I wonder whether it is possible to do such a thing with CSS: i need my layout to have right margin two times less then left. Something like:

<-- (2*n px margin) [fixed width div] (n px margin) -->

How? (using css only)

  • 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-27T03:08:09+00:00Added an answer on May 27, 2026 at 3:08 am

    I know you said CSS only, but I’d suggest using javascript in the following way:

    function repad()
            {
                if (navigator.appName=="Microsoft Internet Explorer")
                {
                    var pad = ((document.documentElement.clientWidth-*FIXEDDIVWIDTH*)/3);
                }
                else
                {
                    var pad = ((window.innerWidth-*FIXEDDIVWIDTH*)/3);
                }
    
                document.getElementById("*FIXEDDIV*").style.marginLeft = ((pad*2)+"px");
            }
    

    Obviously replacing things in *’s with their proper values.

    This way it’s scalable to the browser size

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

Sidebar

Related Questions

I have a need for a fixed-size (selectable at run-time when creating it, not
I'm using the multi-column CSS layout in a fixed height element so the browser
I have a div with a fixed size of 100px. scrollWidth and scrollHeight works
If I have an array of a fixed size depending on how it is
I have a CDHTMLDialog running in IE that has a fixed size that I
Suppose you have a large file made up of a bunch of fixed size
I have a ListView whose size is fixed to maximum of 10 items View
I have a fixed-length data file need to persistence into database. I use a
I have a number of rather large binary files (fixed length records, the layout
I have the following code: <table style=width: 100%; max-width: 800px; table-layout: fixed;> ... table

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.