Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
vertical gaps in ie6 and ie7
Old 11-18-2009, 05:18 PM vertical gaps in ie6 and ie7
Ultra Talker

Posts: 254
Trades: 0
my question is about ie6 and ie7 creating unwanted vertical gap of 3px

in my page i have an outer div which is holding 4 inner divs following is the code

#outer{
float: left;
width: 900px;
height: auto;
}

#outer .inner1{
float: left;
width: 200px;
height: auto;
}
#outer .inner2{
float: left;
width: 200px;
height: auto;
}
#outer .inner3{
float: left;
width: 200px;
height: auto;
}
#outer .inner4{
float: left;
width: 300px;
height: auto;
}

after this a new div starts with width 900px with the remaining page content, in order to clear the floats before the new div starts i have used

<br class="break" />
.break{
clear: both;
}


due to this the next div top edge starts exactly below the bottom edge of the outer div which is holding the inner divs, only in ie6 and ie7 there is a small vertical gap which i want to remove, as of now i have used
*margin: -3px 0 0 0; and _margin: -3px 0 0 0; for ie6 and ie7 for the next div and it looks similar to all other browsers

instead of using the -3px top margin is a way i can avoid the 3px vertical gap that ie is creating.
can i change .break to
.break{
clear: both;
height: 1px;
}

i am not very sure of this. sometimes this code also works <div class="clear"></div> .clear{clear: both;} as an alternative to <br class="break" />

also i have tried using the following code to fix ie6 and 7

* html .divname{
margin: -3px 0 0 0;
}
*+html .divname{
margin: -3px 0 0 0;
}


the advantage of using * html does not give any warnings when i validate the code from w3.org website however using _ and * gives a warning message for using _ and *

please advice if there is a way to avoid the 3px gap in ie6 and 7 without the above code or if there is no other alternative other than to use any of the 2 techniques

thanks.
sudhakararaog is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-19-2009, 04:11 PM Re: vertical gaps in ie6 and ie7
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Quote:
due to this the next div top edge starts exactly below the bottom edge of the outer div
Yup, which is why using a break like that is not the best solution.

Put clear:both on the div that FOLLOWS the 4 floated ones and that should do the trick.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 11-19-2009, 04:28 PM Re: vertical gaps in ie6 and ie7
Ultra Talker

Posts: 254
Trades: 0
thanks for replying

i have removed <br class="break" /> and also <div class="clear"></div> and both the classes have the code = {clear: both;}

and i have cleared the float that begins after the 4 inner divs as
#divname{
clear: both;
float: left;
width: 618px;
height: 41px;
padding: 0 0 10px 0;
background: url(images/image.jpg) no-repeat;

}

however i still see the 3px gap only in ie6 and 7 the remaining browsers work fine. only when i have the following code ie6 and 7 display like all other browsers

* html .contentright {
margin: -3px 0 0 0;
}

*+html .contentright {
margin: -3px 0 0 0;
}


please advice.

thanks.
sudhakararaog is offline
Reply With Quote
View Public Profile
 
Old 11-20-2009, 02:50 PM Re: vertical gaps in ie6 and ie7
Novice Talker

Posts: 5
Name: Techcrawl.com
Trades: 0
You can attach a seperate stylesheet that only loads in Internet Explorer, and offset it by 3 pixels that way. Internet Explorer never makes things easy on anybody.
__________________

Please login or register to view this content. Registration is FREE
news
Techcrawl is offline
Reply With Quote
View Public Profile
 
Old 11-21-2009, 12:33 PM Re: vertical gaps in ie6 and ie7
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
You do NOT want to put hacks like that into your CSS. Use conditional comments to call separate 'fixes only' css files to target IE's bugs.

You may be dealing with IE's 3px bug - www.positioniseverything.net for lots of IE bug-fixing solutions.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to vertical gaps in ie6 and ie7
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18426 seconds with 12 queries