Topic: UL In DIV effecting containing DIV margins Pages that link to <a href="https://ozoneasylum.com/backlink?for=27285" title="Pages that link to Topic: UL In DIV effecting containing DIV margins" rel="nofollow" >Topic: UL In DIV effecting containing DIV margins\

 
Author Thread
Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

IP logged posted posted 01-08-2006 21:55 Edit Quote

I have the following:

<div> div on top of nav div below filled black should bump up to div below</div>
<div>
<ul>
<li> ... </li>
</ul>
</div>

They don't bump: top divs bottom should touch bottom divs top. I've tested this by removing the list element in the bottom div to see that they do then touch. I've also undone any style that I may have applied to the list element (incase I was causing it) but to no prevail. Regardless, any style to the list element should happen within the containing div and not effect the layout of the div.

A bug?

reisio
Paranoid (IV) Inmate

From: Florida
Insane since: Mar 2005

IP logged posted posted 01-08-2006 23:06 Edit Quote

links are better than code snippets, but I have a feeling this will help you:

code:
ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

IP logged posted posted 01-08-2006 23:40 Edit Quote

Related:
http://www.ozoneasylum.com/27286

..at the time I did not have a sample online. I do not understand why the properties of the UL would have and effect on the containing div.

Karl..

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

IP logged posted posted 01-09-2006 09:35 Edit Quote

Are you sure it's not simply the margin-collapse in action ? in which case it's absolutely normal and described behavior by the Specifications of CSS 1.0 / 4. Formatting model / 4.1. Block-level elements

What is the style and computed style of your DIVs, UL and LI ? in which browsers do you see a problem ?



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu