Closed
Bug 1132812
Opened 11 years ago
Closed 10 years ago
negative margin-top not reducing the margin
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: n.uranbold, Unassigned)
Details
(Keywords: testcase-wanted)
Attachments
(4 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36
Steps to reproduce:
Hello,
I am Theme developer and i created customize able theme and i have one problem and if i set the Margin Negative value on container -> Example: Check one of our theme http://themes.themewaves.com/rebound There has a middle of that website "A Few Main Features of Rebound WordPress Theme" Container has top margin negative and that displayed wrong on Firefox.
Is there are any chance to set it correctly? We are trying to position: relative and top:-10px etc and that's not working.
Actual results:
I am Theme developer and i created customize able theme and i have one problem and if i set the Margin Negative value on container -> Example: Check one of our theme http://themes.themewaves.com/rebound There has a middle of that website "A Few Main Features of Rebound WordPress Theme" Container has top margin negative and that displayed wrong on Firefox.
Is there are any chance to set it correctly? We are trying to position: relative and top:-10px etc and that's not working.
Expected results:
In the Google Chrome browser it's working good.
Comment 1•10 years ago
|
||
This issue is still present on latest Nightly build (46.0a1-20151227030239). Verified this also on Chrome were the expected result is met, but when it comes to Edge and IE, the behavior is the same as on Firefox.
I am assigning a component for this possible issue to see the developers opinion. Maybe someone with more experience on this could provide more information on this.
Thanks,
Paul
Component: Untriaged → Layout
Product: Firefox → Core
A simplified testcase would be useful here.
Keywords: testcase-wanted
Summary: Margin Negative → negative margin-top not reducing the margin
Comment 3•10 years ago
|
||
(In reply to Uranbold from comment #0)
> Check one of our theme http://themes.themewaves.com/rebound There has a
> middle of that website "A Few Main Features of Rebound WordPress Theme"
> Container has top margin negative and that displayed wrong on Firefox.
Paul or Uranbold: Could you clarify what the problematic element is in the page, with the negative margin-top that seems to be ignored? I don't see a negative margin-top on any ancestor of that "A Few Main ..." text mentioned in comment 0. (Though that may just be because the page has changed since this bug was filed.)
(I *do* see an empty <div style="margin-top: -40px;"></div> up a few levels from that text. But that element is empty, and its margin also doesn't seem to affect the layout in either Firefox or Chrome [i.e. disabling the margin has no effect], so I don't think it's what you're talking about.)
I also don't see any obvious rendering difference between that section of the page in Firefox Nightly vs. Chrome Dev Edition, BTW.
Flags: needinfo?(paul.oiegas)
(In reply to Daniel Holbert [:dholbert] from comment #3)
> (I *do* see an empty <div style="margin-top: -40px;"></div> up a few levels
> from that text. But that element is empty, and its margin also doesn't seem
> to affect the layout in either Firefox or Chrome [i.e. disabling the margin
> has no effect], so I don't think it's what you're talking about.)
I see a rendering difference between Firefox and Chrome where this element is, as though it were ignored in Firefox.
Comment 5•10 years ago
|
||
Hi guys,
I think the reporter refers to the margin that is to large on top of "A few main features of rebound wordpress theme" text. But this may be rather related to the website implementation than the browser itself. I'm not so good at programing so I involved you guys to help us out on this matter if you can.
I am attaching a screenshot with the difference between Chrome and Firefox.
Flags: needinfo?(paul.oiegas)
Comment 6•10 years ago
|
||
Thanks for the screenshot!
So, on my machine, with Chrome Dev Edition (Version 49.0.2593.0 dev (64-bit)), that area is actually a bit *larger* in Chrome than in Firefox. (and much larger than Chrome in your screenshot).
Maybe this was a Chrome bug and they fixed it?
Comment 7•10 years ago
|
||
Retested this on latest Nightly build (47.0a1-20160210071115) and it looks the same. The funny thing it's that on latest Chrome version (48.0), it looks the same as on Firefox now. Same on IE 11 and Edge browser.
In my opinion this may have changed now from a browser issue to a website coding issue. Has anyone an idea on how to set that margin to help the reporter so we can close this as invalid ? :)
Thanks,
Paul
Flags: needinfo?(dholbert)
Flags: needinfo?(dbaron)
Comment 8•10 years ago
|
||
(In reply to Paul Oiegas [:pauloiegas] from comment #7)
> Retested this on latest Nightly build (47.0a1-20160210071115) and it looks
> the same. The funny thing it's that on latest Chrome version (48.0), it
> looks the same as on Firefox now. Same on IE 11 and Edge browser.
Ah, great! So, everyone agrees now, I suppose?
> In my opinion this may have changed now from a browser issue to a website
> coding issue. Has anyone an idea on how to set that margin to help the
> reporter so we can close this as invalid ? :)
I think the problem that the author is trying to correct is:
- they've got 2 nested <div class="col-md-12">
- Each of those divs has "display:inline-block" and "margin-top: 40px".
- So there's a total of 80px of margin-top before the text starts.
The author is trying to add an element with "margin-top: -40px" to counteract one of those nesting-levels' 40px margins.
I believe this should work, *if they put the negative-margin element inside of the <div class="col-md-12">. Right now it's just *before* that element.
Flags: needinfo?(dholbert)
Comment 9•10 years ago
|
||
Here's a screencast illustrating my previous comment. In particular:
- It shows the 2 layered "col-md-12" divs that each have margin-top:40px
- It shows that moving the dummy negative-margin element inside seems to fix the problem (very end of the screencast).
Comment 10•10 years ago
|
||
(Note that margins don't collapse from inside an inline-block to outside the inline-block; that's perhaps what the author was expecting to work here, but was not working.)
In any case, it seems this is "invalid" as a Firefox bug, since browsers agree on the rendering, and we seem to be doing what the spec requires. (Or if we're not, we need a more targeted testcase to demonstrate that I think.)
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
Updated•10 years ago
|
Flags: needinfo?(dbaron)
You need to log in
before you can comment on or make changes to this bug.
Description
•