Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Netscape and divs

Status
Not open for further replies.

ChrisRChamberlain

Programmer
Mar 23, 2000
3,392
GB
Hi all,

Have a page with 3 divs following in succession down the page.

Rightly or wrongly, the last tag in each div, width:100%, is <p> to force a space between the divs.

IE renders the page as expected, NS ignores the <p>.

Any way of resolving the issue?

TIA

FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommandertm.com
PDFcommandertm.co.uk


 
A <p> inside a div shouldn't make space between the divs. Can you post some of the actual html and stylesheet?

 
philote

Thanks for your response - the page, with additional divs, is at:-


Inside or following the div, <p> forces a break in IE but not in NS.

stylesheet for div is:-

Code:
.image_left{
[tab]left: 0px;
[tab]width: 100%;
}

FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommandertm.com
PDFcommandertm.co.uk
 
Rightly or wrongly, the last tag in each div, width:100%, is <p> to force a space between the divs
That'll be "wrongly".
if you added a padding-bottom value to the div, would that resolve it?
Almost, but that would put the space inside the <div>. What you need is some bottom margin:
Code:
div {
   margin-bottom: 1em;
}


-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
LOL!

Oh, dang, now I'll get red-flagged, too. Let's just say my name is Chris. ;-)
 
Thanks to all the Chris's, real or honarary!

It is aligning correctly in NS now, excepting that NS does not seem to respect
Code:
margin-bottom: 1em
and closes up the space between the divs.

What thoughts?

FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommandertm.com
PDFcommandertm.co.uk


 
As one of the Chris's pointed out (Chris Hunt to be precise), you can use a technique to prevent the images from dropping below the bottom of the divs. This is where your problem is, as you can see if you add a border around the divs. The link Chris gave describes a solution where you basically have to add:
Code:
.image_left:after{
    content: "."; 
    display: block; 
    height: 0; 
    clear: both; 
    visibility: hidden;
}
to your style sheet.

I believe IE is incorrect to add spacing between the bottom of the image and the top of the next div, but the above fix should make it display the same in NS and IE(perhaps not IE for Mac, look at Chris's link for details).

Hope that helps,
Chris
;-)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top