- This topic is empty.
January 13, 2015 at 11:12 am #193100
Is this supposed to be the way? What’s the logic behind it?
Here is the url for a demo.January 13, 2015 at 11:39 am #193107shaneismeParticipant
You’re looking for collapsing margins:January 13, 2015 at 3:13 pm #193126
I’m not sure if it’s the same issue. My case is about an outer box and an inner box (not two sibling boxes next to each other). If I set a margin for the inner box, I’d expect to see the margin around the inner box (don’t you expect so too?), not outside the outer box.January 13, 2015 at 3:55 pm #193140SenffParticipant
That is explained under “Collapsing Margins Between Parent and Child Elements” in @shaneisme’s link above.January 13, 2015 at 4:23 pm #193141
Thanks. I hadn’t read the further down. But I disagree with the author on that such behavior is often desirable. By default, the margins should be kept separate and a css type (say margin-collapse: collapse;) could be made available to collapse the margins if ever so desired (or just set the margin to 0 ). Though now you can have a border or padding to prevent margin collapse, it may not be desirable to have a border or padding no matter how thin it is (let alone that 1 pixel border might even destroy your overall layout as shown in my other examples). So again I propose to have a new css type (say margin-collapse: none;) to prevent the margin collapse.January 13, 2015 at 4:32 pm #193142shaneismeParticipant
Join the W3C.
Power to the people.January 13, 2015 at 7:34 pm #193157
Hope there’re W3C members here who may read my posts and forward my proposals to the committee for consideration.
- The forum ‘Other’ is closed to new topics and replies.