473,320 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Collapsing margins rule

I've been caught out by what I thought was an Opera 7.5p1 issue:
http://www.spartanicus.utvinternet.i...mage_issue.htm

but as was pointed out to me this is actually a fault in my code which
is exposed by the improved CSS standards support in v7.5p1.

The top margin on the <h1> collapses with the zero margin on the <body>
element to form a single margin equal to the margin specified on the
<h1>.

I predict that this improved behaviour will catch out more people as the
collapsing vertical margin rule is probably not sufficiently understood
by quite a few of us. I've encountered this issue before, but Opera 7.5
is the first browser to implement the collapsing vertical margin rule
correctly with respect to the <body> element.

A good understanding of the box model is helpful in solving potential
problems. In the example given above the problem can be solved by
specifying a 1px padding on the <body> element, the rule for collapsing
margins then no longer applies since the padding exists between the
margin on the <body> element and the top margin on the <h1>.

Btw, Opera 7.5p1 is the first browser to display 2 of my older sites
(coded strictly to the standards with no regard for browser quirks)
without any issues, quite a feat.

--
Spartanicus
Jul 20 '05 #1
0 1601

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Jukka K. Korpela | last post by:
I just noticed that most browsers render <table border="1"><tr><td><p>foo</p></td></tr></table> the same way as <table border="1"><tr><td>foo</td></tr></table> That is, they ignore the p...
12
by: Secret Guy | last post by:
I'm trying to understand generally how to make a grid of variously sized boxes using CSS. The first idea I had was to make a box where I can see the margin, padding, border and content edges, and...
7
by: Kyle James Matthews | last post by:
Hello all, Please have a look at http://www.digitalovertone.com/v3/example.htm. Netscape, Mozilla, and Firefox all insert an upper margin on 1 em on the content on the left, and an upper margin...
5
by: Borris | last post by:
<div style="background-color: blue; width: 500px; height: 300px"> <div style="background-color: red; margin-top: 100px; margin-left: 100px; width: 300px; height: 100px"> </div> </div> Where...
2
by: Stanimir Stamenkov | last post by:
I'm trying to clear some sizing issues relative to the initial containing block and the root document element. The sample document I'm trying with: http://stanio.info/viewport_fill.html ...
1
by: yb | last post by:
Hi, I'm looking for clarification of css 2.1 specification in section 8.3.1 "Collapsing Margins" The 6th bullet reads "If the top and bottom margins of a box are adjoining ..." I won't paste...
6
by: Jack | last post by:
Hello, I would like some advice on how to disable the behavior of treeviews to expand and collapse when double clicked upon, but still allow the user to use the plus and minus on each node. ...
1
by: Jeremy | last post by:
Let's say I have some block elements that self-organize by floating to the left, so if no more blocks can fit in a row they begin on the next row (see crummy ASCII art at end of message). I...
5
by: SlowArrow | last post by:
Here collapsing seems to work differently in vb.net 2005 from that I use to see in vb.net 2003: Using the collapsing in vb.net 2003 shows the whole interface of the methods, subroutines,...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.