CSS - Large White Gap Between Divs In Ie 6
Hi - Im new to css and I need to develop a website for IE 6. I am getting a large gap between two divs for an unknown reason - I would like to have them flush against eachother as they seem to appear in IE 8 but not in IE 6. The two divs with the gap a #welcomeandsearch and #welcometext
below is the basic html and css I am using: Code: #welcomeandsearch {width:940px; float:left; margin: 0px;} #welcome {width:700px; float:left; color:#FFA000; font-size:1.75em; font-weight:normal; margin: 0px;} #welcometext {width:970px; float:left; padding: 0; margin: 0px;} #search {width:190px; float:left; color:#363636; font-size:0.75em; font-weight:normal;} #searchbox {width:200px; float:left; color:#363636; font-size:1.0em; font-weight:normal;} form input.button {width:25px; height:15px; background:#FFC666; color:#363636; font-weight:bold; border:none; font-size:11px; margin:0 auto; padding:0px;} form input.textfield {color:#363636; font-size:0.75em; font-weight:normal;} <div id="welcomeandsearch"> <div id="welcome">Welcome</div> <div id="searchbox"> <form id="form1" name="form1" method="post" action=""> <label>Search:</label> <input name="textfield" type="text" class="textfield" id="textfield" value="enter keywords here" /> <input name="button" type="submit" class="button" value="Go" /> </form> </div></div> <div id="welcometext">to the Customer Self Help Resource. This online resource has been developed to assist all staff with their most common IT related problems and requests.</div> Any help much appreciated! Similar TutorialsI have a page with some very large (dynamically populated) tables in an application. Is there a way to prevent these table from being pushed to a new page when printing? I don't care where the tables break, but what I am trying to avoid is a printed header and then a huge gaping whitespace on the 1st printed page and then the table , that should have been printed just below the header, on a new second page. Any thoughts? Thanks, Stephen I've been trying to solve this problem about my website. My site What it is suppose to look like. Image Thanks in advance. Ok, so I've learned to stay away from tables when you don't need them, and I have an instance where this is the case. I have a container div that has a header, content and a footer. On my home page, I have to divs next to each other with the same height and a div below them towards the right. To simplify my problem, look at this example. Code: <html> <body> <div style="float:right"> Hello there! </div> <hr> </body> </html> If there's a "float:right" on that div, the hr tag below doesn't get pushed down. But if I use relative positioning and don't use the floats, I can't put the two top divs next to each other. The other option is to use absolute positioning, but again content below doesn't get pushed down correctly. It seems that using "clear:both" works, but it seems weird that this has to be done. For example if I have floating divs in a container, I can get them to stretch out the container like so: Code: <html> <body> <div style="border: 1px solid #000; "> <div style="float:right"> Hello there!<br /> Hello there!<br /> Hello there!<br /> Hello there!<br /> Hello there!<br /> Hello there!<br /> Hello there!<br /> </div> <div style="clear: both"></div> </div> <hr> </body> </html> Am I missing something fundamental here? Is there a better solution? Thanks in advance. Here's the site in Question: http://www.winchps.vic.edu.au It's a standard fixed width floated DIV columns with a wrapper. One thing it does have is a second DIV inside both columns to display the Gradient background over the top of the repeated background. It works perfect in Firefox & IE7 (with a tweak) but IE6 mkes the sidebar nested div drop below the original sidebar DIV click here for a screenshot for those lucky enough not to have IE6. Here's the CSS code for the basic layout: Code: body { font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; font-size: 12px; text-align: center; margin: 0px 0px 60px 0px; padding:0px; border: 0; line-height: 2; } #header { width: 802px; } #wrapper { width: 802px; margin:0px; padding: 0px; text-align: left; margin: 0 auto; background: url(images/bodybg.jpg) center repeat-y; } #content { padding: 0px; margin: 0px; } #maingrad { background: url(images/winchcontentgrad.jpg) top left repeat-x; padding: 10px; } #main { width: 589px; float: right; background: url(images/winchcontentbg.jpg) repeat; border-left: solid 1px #000; border-right: solid 1px #000; } #mainstop { width: 589px; float: right; background: url(images/winchcontentbg.jpg) repeat; border-left: solid 1px #000; border-right: solid 1px #000; border-bottom: solid 1px #000; font-size: 10px; } #sidebargrad { background: url(images/winchsidebargrad.jpg) top left repeat-x; padding: 10px 5px 0px 10px; } #sidebar { width: 200px; float: left; background: url(images/winchsidebg.jpg) repeat; line-height: 2; font-size: 14px; border-left: solid 1px #000; border-right: solid 1px #000; } I obviously need to put a conditional comment in there, same for what I did for the minor IE7 tweak, but I'm struggling to suss out what's causing it, I haven't found the specific issue on any of the regular sites (PIE etc). Anyone got any ideas? Centering DIVs inside other DIVs in Firefox? Can it be done in a straight forward way? Setting the inner DIVs float to none seemed to work for IE but not FF. I'm afraid this is another case of "it's working in everything but IE". :-/ On a page I'm working on for someone at the moment, there is a gap between the top navigation bar and the div (id="main") below it. This gap should be 15px, as it seems to be in Firefox and various other browsers. In IE however, the gap between the nav bar and the div is actually much larger and subsequently looks too large. I haven't managed to find a working solution to this problem, so any help would be appreciated. I've uploaded a demo page to http://www.fwbf.net/ttv/. Also, the stylesheet for the page is located at http://www.fwbf.net/ttv/style.css. Thanks. The Example I've read a bunch about how div's won't stretch to accomidate div's inside of them if they overrun the height/min-height set for the container div. How do I get around this? You can see the skeleton of the site above. It's fine unless you resize the window smaller than the content. I am working on a large project and was wondering if you guys could give me advice on how best to approach the CSS setup. Obviously a lot of elements will be set for the project as a whole which can go in a master CSS file. But what is the best way to deal with page specific CSS, should I use a new CSS file for each page or fit everything into one file? Hi! Let's suppose I will build a big PURE CSS site (lots of css). How am going to organize all that CSS? Into separate files? In what style should I write the css? (with or without line-breaks and so on...) Thank you! On http://www.h****inson.co.uk/h****inson5.4 (I guess you can work out the name of the site...I've used a tiny-url in the link though) a horizontal scrollbar is displayed even though there is not content (as far as I can see) that is pushing the sides out this far. Although it is not detremental to the website, can anyone please suggest what is wrong. The main css code is at http://www.h****inson.co.uk/h****inson5.4/files/css.css Thanks for any help. Even though I tag my CSS - it's so large for my site that it's a pain to scroll through and use, even using the search. Is it possible to reference more than one stylesheet from style tags - and have it all work ok? No duplicate classes or anything, I just would like to divide it up into a few different files, but before I do I wanted to know if there's issues with this. Thanks! I have a menu that I'm working on which uses <A> elements for the menu items. I've given these A elements height and width dimensions and background images which works pretty well -- except the text in these A elements is top-aligned. I've tried adding a vertical-align directive in my CSS but this doesn't seem to do anything at all. I'd also like to add a bit of space around the text. Is this possible? here's a bit of my CSS: Code: ul.menu li a { width: 295px; height: 59px; background: url(button_bg.jpg) no-repeat; display: block; padding: 0px; margin: 0px; border: none; } Hi everyone I recently stumbled upon the CSS sprite idea and i've been loving it! Makes changing and adding graphics so much easier. However i've run into a concern. My image sprite is becoming quite large (>150KB) and my HTML code has many divs who's background refers to this sprite (can get upto 100 divs). With this i've started to notice slight sluggishness of my HTML page and got me thinking weather i should divide my large sprite into a number of smaller ones to enhance performance. This is mainly because i have quite a lot of hover effects (which merely shift the background position) and i suspect this is causing the sluggishness and high memory usage. It's far too time consuming to try this myself so i'm wondering if anyone has any experience with such an action. Many thanks I have a data table within my content div. It appears fine on my screen in several browsers, however, coworkers have a large (full screen) of white space where the table should be. They have to scroll down a full screen to get to the table. I have everything on the site set up using CSS. The table contains the dates, times and municipalities for Trick or Treat events. I have a vertical-align:top on the table. Here is the CSS: Code: table#halloween { margin-left: 2px; text-align:center; margin-right:auto; width:100%; vertical-align:top; font-size:12px; padding: 3px; width:100%; border: solid #000000; } td.halloweencell { border-color: #000; border-style: solid; } Here is a sample of the HTML : Code: <table width="100%" id="halloween" summary="Table of municipalities, date of trick or treat and times for trick or treat"> <tr> <th width="50%" class="rowcoloryellow"><strong>MUNICIPALITY</strong></th> <th width="20%" class="rowcoloryellow"><strong>DATE</strong></th> <th width="30%" class="rowcoloryellow"><strong>HOURS</strong></th> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td class="halloweencell" width="50%">City of Hartford </td> <td class="halloweencell" width="20%">October 30th </td> <td class="halloweencell" width="30%">4:00 p.m. - 6:00 p.m. </td> </tr> <tr> <td class="rowcolororange">City of West Bend </td> <td class="rowcolororange">October 30th </td> <td class="rowcolororange">4:00 p.m.- 6:00 p.m. </td> </tr> <tr> <td class="halloweencell">Town of Addison </td> <td class="halloweencell">October 30th </td> <td class="halloweencell">3:00 p.m. - 6:00 p.m. </td> </tr> <tr> <td class="rowcolororange">Town of Barton </td> <td class="rowcolororange">October 30th </td> <td class="rowcolororange">4:00 p.m. - 6:00 p.m. </td> </tr> <tr> <td class="halloweencell">Town of Erin </td> <td class="halloweencell">No Set Schedule </td> <td class="halloweencell"> </td> </tr> </table> It is located at: www.washingtoncountysheriffwi.org/halloween.php Any suggestions? Thanks! Helen I want to create smaller sidebars with large sidebar. Like small boxes within a large box on left hand side and the same on the right. I will put up an example soon but don't i use absolute positioning for the large box, a relative postion within this box for smaller box containers. The css tags are class and an id so I can keep the appearance of each smaller container the same. [link removed] In IE6, the category "At-A-Glance Telephone/Address Book" has a large vertical gap inserted at the first space. It only happens on this page (that I've found). It doesn't happen on other pages with the same number of nested lists. Shortening the name of the category so it doesn't wrap just moves the gap to the next category down. Any idea what's causing this? Thanks much in advance. ------- Someone on another forum figured it out. It was just IE6 choking on the left padding used to indent each sublevel. Reduced the padding for IE6 only to fix it. Hi, I'm working on a site in Css and it all works fine in Firefox. But in IE7 there is a lot of extra white space between elements like after the h2 heads. Anyone know what i'm doing wrong? Here's the code. CSS Code: body { background: #1d1d1d url(../g/header_bg.gif); background-repeat: repeat-x; margin: 0px; padding: 0px; font-family:arial; font-size:11px; line-height:1; font-weight: normal; text-decoration: none; color:#575859; text-align: left; } #container { width: 992px; margin: 0px auto; text-align: left; } ul { list-style:none; padding: 0px; margin: 0px; } input, textarea{ font-family:Tahoma; font-size:11px; color:#000000; vertical-align:middle; font-weight:normal; background:#FFFFFF; text-align:left; } .formfield { width:271px; height:auto; color:#000000; background-color:#FFFFFF; height:18px; margin-right:8px; border: solid 1px #404040; } #header { height: 63px; } .menu { float:left; padding-top:25px; } .menu li { background:url("../g/menu_sep.gif") right 3px no-repeat; padding:0px 10px 0px 15px; float:left; } .menu li a { background:url("../g/menu_arrow.gif") 0 6px no-repeat; color:#181818; font-weight:bold; padding:0px 10px 0px 15px; text-decoration:none; } .menu li a:hover { text-decoration:underline; } .search { float:right; background:url("../g/search_bg.gif") 0 0 no-repeat; width:357px; height:43px; padding:12px 0px 0px 10px; margin-top:10px; } h1.logo { width: 203px; height: 109px; background: url("../g/title.gif"); text-indent: -9999px; margin-left: 10px; } #left_container { float: left; width: 200px; background-color:#000000; margin-right: 20px; margin-left: 10px; } #middle_container { float: left; } #right_container { float: right; } .left_top { width:200px; height:12px; font-size:0em; background:url("../g/left_top_bg.gif"); } .left_bottom { width:200px; height:12px; font-size:0em; background:url("../g/left_bottom_bg.gif"); } #left_container h2 { font-size:1.01em; line-height:1.5; color:#85B102; font-weight:bold; text-transform:uppercase; padding:0px 0 10px 0; margin-left:20px; } #left_container ul { margin-left:20px;} #left_container li { font-size:1.01em; line-height:1.5em; color:#707070;} #left_container li a { font-size:1.01em; line-height:1.5em; color:#707070; text-decoration:none; background:url("../g/arrow.gif") no-repeat 0px 6px; padding:0 0 0 19px;} #left_container li a:hover { text-decoration:underline;} HTML Code: <html> <head> <title>Test</title> <link type="text/css" href="x/style.css" rel="stylesheet"/> </head> <body> <div id="container"> <div id="header"> <div class="menu"> <ul> <li><a href="#">Home</a></li> <li><a href="#">Test2</a></li> <li><a href="#">Test3</a></li> <li><a href="#">Test4</a></li> </ul> </div> <div class="search"> <form method="get" action="search.php"> <input type="text" class="formfield" value=""><input class="submit" type="image" src="g/search.gif" value="submit"> </form> </div> </div> <h1 class="logo">MyTitle</h1> <div id="left_container"> <div class="left_top"></div> <h2>Menu</h2> <ul> <li><a href="#" title="home">Home</a></li> <li><a href="#" title="home">Test2</a></li> <li><a href="#" title="home">Test3</a></li> <li><a href="#" title="home">Test4</a></li> <li><a href="#" title="home">Test5</a></li> <li><a href="#" title="home">Test6</a></li> <li><a href="#" title="home">Test7</a></li> </ul> <div class="left_bottom"></div> </div> <div id="middle_container"> b </div> <div id="right_container"> c </div> </div> </body> </html> Ok guys, I'm hoping someone can help me. I am a complete newbie to CSS and web site construction in general. I have a left vertical navigation bar made up of graphics in a div tag that is set to float on the left. I'm having difficulty with the graphics, they have white spaces in between them when viewed in IE. They are supposed to butt up against one another. I have tried setting the margin and padding in that div to 0. I have also seen in other forums where the <li> tag can be placed on the previous line to fix this problem in IE. I haven't even viewed the page on any other browsers yet, can someone help me please? Thanks so much! vonatah Hi; I am trying to get rid off white space from the bottom of the navigate bar, and tried with height=23px for th or td, but they don't not work, could anyone help me, please. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Yourheadstone.com</title> <style type="text/css"> html head title{ border:0; padding:0; margin:0; } body{ padding:0; border:0; background-color:#3399FF; margin:0; } table tr td{ border: 1px solid #000000; } table{ width:1024px; height:25px; padding:0; border:2px solid #000000; margin-top:5%; margin-right:auto; margin-bottom:auto; margin-left:auto; background-color: #E5FFFF; } tr td{ padding:0; margin:0; } #nav { width: 100%; float: left; margin: 0 0 3em 0; padding: 0; list-style: none; background-color: #f2f2f2; border-bottom: 1px solid #ccc; border-top: 1px solid #ccc; } #nav li { float: right; } #nav li a { display: block; padding: 8px 15px; text-decoration: none; font-weight: bold; color: #069; border-right: 1px solid #ccc; } #nav li a:hover { color: #c00; background-color: #fff; } </style> </head> <body> <table> <tr> <td> <ul id="nav"> <li><a href="#">About Us</a></li> <li><a href="uploadform.php">FAQs</a></li> <li><a href="#">Contact</a></li> <li><a href="#">Headstones</a></li> <li><a href="#">Home</a></li> </ul> </td> </tr> </table> </body> </html> I have layed out the page but cannot seem to get the hang of the floats and positioning....!! If anyone can give me a hint how I can position my text in the main white space I would be so grateful as I am confusing myself as to what i am doing wrong!! the site is hosted at www dot getatrader dot com PLEASE HELP!! here is the CSS: Code: body { background: white; font-size: smaller; font-weight: bold; font-family: Verdana,Arial,Helvetica,sans-serif; } #topnav { float:left; position: absolute; } #topnav img{ display: block; border: none; } #header{ position: relative; text-align: right; border: solid thin #999999; margin: 0px 0px 0px 0px; background: #336699; font-family: Verdana,Arial,Helvetica,sans-serif; color: #ffffff; height: 155px; } #headerright{ position: relative; top: 20px; right: 10px; } #headerright li { display: inline; list-style: none; padding: 40px; } #headerright img { border: none; } #headerright a:link { color: #ffffff; text-decoration: none; } #headerright a:visited { color: #ffffff; text-decoration: none; } #headerright a:hover { color: #ffffff; text-decoration: none; } #headerright a:active { color: #ffffff; text-decoration: none; } h1 { } h2 { width: 200px; text-align: center; color: white; background-color: black; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: large; font-weight: bold; } #container { width: 956px; padding: 10px; margin: 0px auto 0px auto; height: auto; text-align: left; border: 1px solid #ddd; } #button { position: relative; display: block; width: 152px; border-right: 1px solid #000; padding: 0 0 1em 0; margin-bottom: 1em; font-family: Verdana,Arial,Helvetica,sans-serif; background-color: #336699; color: #333; } #button ul { list-style: none; margin: 0; padding: 0; border: none; height: 500px; } #button li { border-bottom: 1px solid #90bade; margin: 0; } #button li a { display: block; padding: 5px 5px 5px 0.5em; border-left: 10px solid #1958b7; border-right: 10px solid #508fc4; background-color: #2175bc; color: #fff; text-decoration: none; width: 100%; } html>body #button li a { width: auto; } #button li a:hover { border-left: 10px solid #1c64d1; border-right: 10px solid #5ba3e0; background-color: #2586d7; color: #fff; } #maintext { position: absolute; float: left; } #footer { color: white; background-color:#336699; font-size: small; font-family: Verdana,Arial,Helvetica,sans-serif; margin: 0px 0px 0px 0px; } |