Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard mouse network printer problem ram registry repair router slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
vertical gaps in ie6 and ie7

Reply  
Thread Tools
sudhakararaog's Avatar
Computer Specs
Senior Member with 117 posts.
 
Join Date: Sep 2007
Experience: Intermediate
18-Nov-2009, 05:17 PM #1
vertical gaps in ie6 and ie7
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.
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:36 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.