473,394 Members | 1,843 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,394 software developers and data experts.

collapsing margins in css 2.1

yb
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 the whole point here, its too long.

But, from this first line does this mean that the element has empty
content, no border, and no padding? Further on in the same point its
mentioned that :

"An element that has had clearance applied to it never collapses its
top margin with its parent block's bottom margin" ... what is this
reffering to? how could it happen that a top margin of a child aligns
with the bottom margin of its parent?

Sorry, I'm somewhat new to learning CSS and haven't found a very
detailed book on newer aspects in CSS 2.1 so I'm really struggling to
understand all the fine points. Is there any clearer explanation of
these specifications? It seems to me that a text description is almost
impossible to understand at times.

Oct 24 '05 #1
1 1707
"yb" <ba*********@yahoo.ca> wrote:
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 the whole point here, its too long.

But, from this first line does this mean that the element has empty
content, no border, and no padding?
Zero height, no border and no padding, it may have content. A practical
example of such a box could be a div containing only a floated element.
Further on in the same point its
mentioned that :

"An element that has had clearance applied to it never collapses its
top margin with its parent block's bottom margin" ... what is this
reffering to? how could it happen that a top margin of a child aligns
with the bottom margin of its parent?
IIRC CSS margins collapse when they are adjacent, this can lead to
ridiculous situations described by the quoted paragraph, i.e. a child's
top margin being adjacent to it's parent's bottom margin.
Sorry, I'm somewhat new to learning CSS and haven't found a very
detailed book on newer aspects in CSS 2.1 so I'm really struggling to
understand all the fine points. Is there any clearer explanation of
these specifications? It seems to me that a text description is almost
impossible to understand at times.


CSS float and collapsing margin rules are ridiculously complex, as a
result browser implementations are wildly inconsistent. Combined, the
resulting difficulties are a common cause of frustration for content
authors.

Many of the authoring problems with floats and collapsing margins are
the result of inappropriate usage of floats, like creating IE compatible
"CSS layouts". Floats used appropriately are less of a headache.

--
Spartanicus
Oct 24 '05 #2

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

Similar topics

0
by: Spartanicus | last post by:
I've been caught out by what I thought was an Opera 7.5p1 issue: http://www.spartanicus.utvinternet.ie/test/opera7.5p1_css_background_image_issue.htm but as was pointed out to me this is actually...
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 ...
8
by: Tinus | last post by:
Hello all, Because you have been so helpfull the last couple of times, I thought after testing and wasting more than 20 pages (and google-ling for 3 days :-( ). I would ask you again for your...
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. ...
0
by: Todd | last post by:
Hi guys, Strange bug if someone could help. ... Im using printDialog, printDocument and printPreviewDialog to write my print routines for a graphics application. I want to allow the user to...
7
by: Mark | last post by:
Hi, I am creating application in VB 2005. and when I print report it adds extra 0.45 cm margin on left and top, and the reason for this is physical margins of printer. Is it possible to change...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.