This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

সহায়তা খুঁজুন

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

আরও জানুন

percentage-based vertical positioning dependent on block width?

  • 1 উত্তর
  • 6 এই সমস্যাটি আছে
  • 1 দেখুন
  • শেষ জবাব দ্বারা schwal

more options

I seem to have found an issue when firefox is positioning blocks based on percentage values and margin offsets.

in short, look at this page: http://akos.maroy.hu/~akos/frontend/experiment/awake.html

the intended size of the image section is 75% of the available area, both vertically and horizontally. the intended location of the image section is so that the it's in the middle both vertically and horizontally.

while this works horizontally, it seems that the vertical position of the image depends on the horizontal width of the window. if one changed the width of the window, the image will shift vertically.

I seem to have found an issue when firefox is positioning blocks based on percentage values and margin offsets. in short, look at this page: http://akos.maroy.hu/~akos/frontend/experiment/awake.html the intended size of the image section is 75% of the available area, both vertically and horizontally. the intended location of the image section is so that the it's in the middle both vertically and horizontally. while this works horizontally, it seems that the vertical position of the image depends on the horizontal width of the window. if one changed the width of the window, the image will shift vertically.

সমাধান চয়ন করুন

This is not exclusive to Firefox. Your problem is that margin-top uses "%" to mean "% of width". http://www.w3schools.com/cssref/pr_margin-top.asp

প্রেক্ষাপটে এই উত্তরটি পড়ুন। 👍 1

All Replies (1)

more options

চয়ন করা সমাধান

This is not exclusive to Firefox. Your problem is that margin-top uses "%" to mean "% of width". http://www.w3schools.com/cssref/pr_margin-top.asp