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

  • Home
  • SEARCH
  • 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 6575047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:20:22+00:00 2026-05-25T15:20:22+00:00

In this JSFiddle http://jsfiddle.net/9UMRk/ A div has a margin-top of 50%. Which I would

  • 0

In this JSFiddle

http://jsfiddle.net/9UMRk/

A div has a margin-top of 50%. Which I would expect to adjust to the page height.

However, if you resize the window in Firefox (3 & 4), you’ll see the div’s vertical positioning is affected by the page width, but not the page height.

Why?

  • 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-25T15:20:22+00:00Added an answer on May 25, 2026 at 3:20 pm

    It does seem counter-intuitive, but is in fact in accordance to the box model for margins, which states, in the CSS level 2.1 spec:

    The percentage is calculated with respect to the width of the generated box’s containing block. Note that this is true for ‘margin-top’ and ‘margin-bottom’ as well. If the containing block’s width depends on this element, then the resulting layout is undefined in CSS 2.1.

    And in the CSS3 spec (more clearly IMO):

    Note that in a horizontal flow, percentages on ‘margin-top’ and ‘margin-bottom’ are relative to the width of the containing block, not the height (and in vertical flow, ‘margin-left’ and ‘margin-right’ are relative to the height, not the width).

    (Bold emphases mine.)

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

Sidebar

Related Questions

I have this jsFiddle: http://jsfiddle.net/HMZuh/1/ Which contains this html <div ng-app ng:controller=ShowHideController> <div ng-show='showMe'>
I this: http://jsfiddle.net/ZP76c/ I'm trying to control the scope at which jQuery selects elements
I have created a fiddle to test this : http://jsfiddle.net/Ninjanoel/X6ShS/ which works fine :(
Check out this jsfiddle http://jsfiddle.net/Y7fEW/ . I'm trying to get the tan div on
I have this jsfiddle http://jsfiddle.net/fwQq4/19/ Here I have the wrapper class ( div.wrapper )
Please, observe this simple jsFiddle: http://jsfiddle.net/mark69_fnd/vtLrt/10/ HTML: <div class=char> <div> <div class=char>A1</div> <div class=char
As illustrated in this jsfiddle: http://jsfiddle.net/qrbhb/ If you take this markup: <div>There should be
Have a look at this jsfiddle: http://jsfiddle.net/Dh96F/1/ The Expand button will animate the widening
I'll let this jsfiddle describe most of the problem for me. http://jsfiddle.net/zAPVQ/4/ I've got
I have a setup like this: http://jsfiddle.net/zzjSC/3/ and I am wondering why the surrounding

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.