Jump to content

[SOLVED] IE6's stupid 3px div spacing


FridayRain

Recommended Posts

I've Googled, found a fix or two, and nothing seems to work. I can't wait for IE6 to die a horrible death.

 

What you're seeing is a container div with three subcontainers inside: top, middle, bottom. Inside the top and bottom divs are three more divs: one for the left corner rounded edge, one for the middle filler, and one for the right rounded edge. The corner divs use a background graphic, and are floated left or right. The middle subcontainer is just the main background color.

 

It is my understanding that this 3px spacer "bug" only happens with floated divs, but maybe it's not.

 

I found this:

 

/* hide from Mac \*/

* html .chain1 {
margin-right: -3px;
display: inline;
}

* html .chain2 {margin-left: 0;}

/* end hide */ 

 

But it didn't work. I applied it to several different divs and such and the space remained. Any other ideas? I'm sure this is a common problem. I really don't want to scrap my rounded corners and find a completely new way to do them. I don't like being able to highlight them on the page, nor do I like being able to right-click them. I like having them "below the surface" if you will.

 

 

The first image is a dig with IE6. The second is with Firefox.

 

[attachment deleted by admin]

Link to comment
Share on other sites

I think there are ways to make rounded corners and stuff in CSS now, without any kind of images of javascript or anything.

 

Try googling around a bit.

 

Yes that's called CSS3 beta. I heard FF already has put that in version 2.0 but of course IE6 doesn't have it!

 

Duh!

 

Um, why don't you just make that whole thing one simple background image? Is saving 2 kb worth your headaches and hard work?

 

Or, use absolute positiong, - in a nested div tag that is relative or static (ly) positioned.

Link to comment
Share on other sites

I really want to use images though. My corners aren't just rounded. They have a gradient that I really like using. Looks great in Firefox. If I add POSITION: ABSOLUTE; to .tlw, the 3px gap disappears, but I can't say the same for .trw. What needs to change in my CSS?

 

.topwindow {
    width: 100%;
    height: 22px;
    background: #transparent; }

.tlw {
    float: left;
    width: 22px;
    height: 22px;
    background: url(graphics/window/tl.gif); }

.trw {
    float: right;
    width: 22px;
    height: 22px;
    background: url(graphics/window/tr.gif); }

.topfillw {
    height: 22px;
    background: url(graphics/window/topfill.gif); }

 

 

 

<div class="topwindow">
                    <div class="tlw"></div>
                    <div class="trw"></div>
                    <div class="topfillw"></div>
</div>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.