CSS - Extra White Space
I have 2 columns. The main one and the sidebar. The problem is that the sidebar extends down the page further then the main column. I am using a color in the background. The color does not extend all the way down. The main area stops about half way down the sidebar and just leaves white space there. The whole page is colored except for this square of white in the middle. Also if I extend the main area content to be longer then the sidebar then the sidebar will have white underneath it instead.
Similar TutorialsI 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; } 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 So I am trying to move from designing in <tables> and move on to the beauty of the CSS box-model design. I have been inspired by one of the ZenGarden designs and wanted to see if I could try and duplicate it's flow. I am running into a problem. I have created the outer box "#mainBox" and nested within this I have a child "#pageHeader." Problem is that there is this big amount of space (that is present in both IE6 AND FireFox 1.0) at the bottom of "#pageHeader." See the attached pic for the exact detail. Here is my code: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> <html><head><title>The Shalom Foundation</title> <style type="text/css"> <!-- body { text-align:center; background-color:#666666; margin:0 0 50px 0; /* top right bottom left */ } p{ padding:0; margin:0; text-align:justify; } #mainBox { float:right; margin:9px 12px 0 0; padding:0px; width:733px; text-align:left; background-color:#999999; } #pageHeader{ background: url(images/layout/header.jpg) no-repeat top left; padding:0; margin:0; text-indent: -15000px; height: 290px; overflow: hidden; } #nav{ position:absolute; right:100px; margin:0; background: url(images/layout/menu.jpg) no-repeat top left; padding:0; margin:0; width:136px; height: 302px; overflow: hidden; } --> </style> </head> <body> <div id="mainBox"> <div id="pageHeader">The Shalom Foundation</div> <div id="nav">Nav</div> <div id="contentHdr"><table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"><tr><td valign="middle"><img src="images/layout/hdr_about_us.gif"></td></tr></table></div> <div id="content"><p>Magnus es, domine, et laudabilis valde: magna virtus tua, et sapientiae tuae non est numerus. et laudare te vult homo, aliqua portio creaturae tuae, et homo circumferens mortalitem suam, circumferens testimonium peccati sui et testimonium, quia superbis resistis: et tamen laudare te vult homo, aliqua portio creaturae tuae.tu excitas, ut laudare te delectet, quia fecisti nos ad te et inquietum est cor nostrum, donec requiescat in te. da mihi, domine, scire et intellegere, utrum sit prius invocare te an laudare te, et scire te prius sit an invocare te. sed quis te invocat nesciens te? aliud enim pro alio potest invocare nesciens. an potius invocaris, ut sciaris? quomodo autem invocabunt, in quem non crediderunt? aut quomodo credent sine praedicante? et laudabunt dominum qui requirunt eum. quaerentes enim inveniunt eum et invenientes laudabunt eum. quaeram te, domine, invocans te, et invocem te credens in te: praedicatus enim es nobis. invocat te, domine, fides mea, quam dedisti mihi, quam inspirasti mihi per humanitatem filii tui, per ministerium praedicatoris tui.</p></div> <div id="rightNav">rightNav</div> <div id="pageFooter">pageFooter</div> </div> </body> </html> Thanks in advanced for any help! 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> I'm working on a web site that has a jFlow slideshow (not implemented just yet) and I was mocking up a page with just a plain img in its place. When the page is viewed in FF 3.5, there is extra space to the right and bottom of the image. However, it shows as expected in IE8. I can't figure this out for the life of me. If I "use border box model" from the Google Web Developer toolbar in FF, it shows as desired as well. Here's a link to the file: http://www.websimage.com/3238/index2.html I've been trying to figure this out for a while now and I'm getting nowhere but frustrated, so any help you could provide would be *greatly* appreciated. EDIT: I've found some information regarding box-models, and have applied the -moz-box-model: border-box; which seems to have eliminated the additional space within the gray div...however, there is an additional 10px of unwanted padding on the right & left of it now. I can live with this, but I don't want to if I don't have to. Edit #2: If I take out the margin-left: auto; and margin-right: auto; (to center it) the extraneous padding is not on the left, but is added to the extraneous padding on the right. All the math adds up when it comes to the widths and padding specified for the respective "wrappers" so I'm at a loss as to what's causing this. http://www.zombiepolitics.com Just when I thought I had this down .. I dont. I have a CSS layout .. there are two main divs side by side, the navigation rests at the top of the right div. problem is in IE 6 there is so much extra space at the top that my navigation doesnt line up with my header .. in FF its no problem. What is the workaround for this? 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> For some reason, I cannot for the life of me figure out why Firefox is adding space at the top of my page. I have a container div that contains my header, body, and footer. I have done this: Code: #container{ width: 732px; margin: 0px auto; } Too me that should fix the issue. I even tried applying that code to the body{ ... } but that doesn't work either. Has anyone else gone through this before. There is no space in IE6 or IE7. Thanks, teamhonda81 For some reason, I cannot for the life of me figure out why Firefox is adding space at the top of my page. I have a container div that contains my header, body, and footer. I have done this: Code: #container{ width: 732px; margin: 0px auto; } Too me that should fix the issue. I even tried applying that code to the body{ ... } but that doesn't work either. Has anyone else gone through this before. There is no space in IE6 or IE7. Thanks, teamhonda81 I added a nav bar to my page. when I did so I now get a white space at the top of the page above the pictures I'm not sure why. Here's a link the the page Dead Link(Link removed because it contained copyrighted content that was more than fair use would allow for. I don't want my friend getting in trouble) any help would be appreciated. I have an extra PHPNuke (Ravennuke 2.02) module for the start page. Several pieces of information are displayed in various cells of a table. I have a problem were there is some extra space at the beginning of a table that I cannot get rid of. I saved the output and uploaded he http://www.linux-tutorial.info/index_test3.html after the site title and before the tag line "The place where you learn Linux", there is a large space. In this example, the title is in a separate table, followed by a new table for the information blocks. If I put them in the same table the space appears before the title block. The relevant block of code looks like this: Code: <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td class="welcome_title_box" valign="top" colspan="2"> <div align="center" class="welcome_main_title"> Welcome to the <br>Linux Knowledge Base and Tutorial</div> </td></tr></table> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td valign="top" width="50%"> <span class="subtitle">"The place where you learn Linux"</span> <br><br> Looking for an in-depth and easy-to-understand introduction to Linux? Then look no further! <br> We don\'t just show you how to execute a handful of commands and use a few utilities. The Linux Tutorial goes beyond the basics, providing you with the knowledge necessary to get the most out of your Linux system. <br><br> Jump right in by clicking <a href="http://www.linux-tutorial.info/modules.php?name=MContent&pageid=224"> here</A>. </td> If I removed the highlighted code, the space appears before the site title. If I remove the whole DIV containing the title, I still have the space above the tag line. This says to me that it is not related to the division. It seems that this row or the table itself is pulling the formatting from somewhere else. That would be a logical consequence of the cascading aspect of CSS, but I do no see where it is gettign the space from. Admittedly I am not all that good with CSS/formatting, so it is possible (if not likely) that I overlooked something. Note that in the index_test3.html, I close the table at the end of the first row (prior to the list of news and threads) then open a new table: Code: </table><table border="0" cellpadding="0" cellspacing="0" width="100%" > If I change BGCOLOR for the first table and then change the line above to this: Code: </table>HERE<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="RED"> The space is after the word "HERE". If I remove this code, the extra space is right after the row/div with the site title and before the row with the tag-line. This all make me think that the extra space is being added before the next table, as opposed to at the end of the previous table. There are a number of posts in the CSS forum that I tried like changing the margin (style="margin: 0px"), but none of the solutions solved the problem. I have tried all sorts of combinations of spacing and alignment, but I cannot get rid of this space. I have tried loaded the page with multiple browsers (Konqueror, FIrefox, IE 6) with the same results, so I do not think it is a browser specific issue. Any and all input is greatly appreciated. any body know what i need to add to this CSS to get the 2px looking white space that sits to the left of each <li>? Code: <ul id="navlist"> <li><a href="index.html">Home</a></li> <li><a href="about_us.html">About Us</a></li> <li><a href="contact_us.html">Contact Us</a></li> <li><a href="contact_us.html">Contact Us</a></li> <li><a href="contact_us.html">Shipping Information</a></li> <li><a href="contact_us.html">Return Policy</a></li> <li style="border-right:none;"><a href="showcart.cfm">View Cart</a></li> </ul> Code: #navlist li { font-size: 12px; font-family: Helvetica, Times, serif; display: inline; list-style-type: none; padding-right: 10px; padding-left: 10px; border-right: 1px solid black; background-color: #D5DED9; } In IE6, there is an annoying white space at the top of this page: http://gamingz.com/rpganew/test2.html . This is mostly in the 1024 by 768 + resolution. (I think) I can not figure out what is causing it. I simply want it to be at the very top. Also, it looks fine in IE7 but unfortunately I'm stuck with using it! The page is validated. (And as for the giant white space at the bottom, I'm still trying to figure out how to get to the two main boxes (grey and blue) to stretch 100% vertically. But, that is not as important right now.) Thanks I'm having a weird quirk happening at the bottom of a page I am developing. There is extra space, maybe 80-100px of it, showing up at the bottom in my container div (which I have id'd as "reality"). Can anyone suggest what might be shoving all that extra space in there? html page: http://www.iainhamp.com/reality/hyborianwar.html css page:http://www.iainhamp.com/reality/reality_hyborian.css Thanks for any help you can provide. - iain Hi, Can anyone please explain why the more text I add to the main content area 'full-size' div.... the more spacing gets added below it. Is there a way to stop this? example herel Code: /*begin normal CSS ----------------------------------------------------*/ body { text-align: center; background: #362f25; color: #333; font: 12px "Trebuchet MS", Arial, Helvetica, sans-serif; } #wrap { margin: 0 auto; width: 960px; text-align: left; background: #f8f4f2 url(images/bg-wrap.gif) repeat-y 0px 0px; padding-bottom: 5px; } /*classes ----------------------------------------------------*/ .full-size { margin-left:20px; margin-top:20px; width: 700px; font: 12px; position:relative; left:180px; top:-370px; } /*header ----------------------------------------------------*/ #header { height: 50px; background: #362f25; color: #d2cccb; font: 15px "Palatino Linotype", Arial, Helvetica, sans-serif; } /* left nav menu ----------------------------------------------------*/ #navcontainer { width: 170px; border-right: 1px solid #000; padding: 0 0 0 0; margin-bottom: 10px; font-family: Verdana, Lucida, Geneva, Helvetica, Arial, sans-serif; background-color: #90bade; color: #333; position:relative; left:0px; top:-30px; } #navcontainer ul { list-style: none; margin: 0; padding: 0; border: none; } #navcontainer li { border-bottom: 1px solid #90bade; margin: 0; } #navcontainer li a { display: block; padding: 5px 5px 5px 0.5em; border-left: 15px solid #006865; border-right: 10px solid #203654; background-color: #2175bc; color: #fff; text-decoration: none; width: 100%; } html>body #navcontainer li a { width: auto; } #navcontainer li a:hover { border-left: 15px solid #203654; border-right: 10px solid #006865; background-color: #2586d7; color: #fff; } Misalignment - white space in IE 8 Hi Not able to find the cause of the spaces in IE8. works perfect in FF http://tinyurl.com/26resg9 The same code on different website works fine in both IE8 and FF http://tinyurl.com/y9hvmmw I know the problem is somewhere here in main.css file Code: .content-wrap{ background:url(watermark.jpg) no-repeat; width:1000px; margin:0 10px; padding:0; } Can someone help? I can't seem to pin down why I have extra space to the right of my containing DIV on my home page. All of the sub-pages (similar page layout) render fine, but the home page displays a bunch of space to the right. Any ideas? You can see what I mean at www . deepwaterchurch . com I am working on a site and have found a problem that I can't explain on my own. I would like someone to look at this site: http://www.canada-training-group.ca and tell me why there is extra space at the top in IE but not in Firefox. Thanks, Timmy-d I read several threads on devshed, but cannot seem to resolve the issue. I am trying to line up my text and images within a div or span tag with the table just below it such that there is no white space in between. It works in Firefox. Link demonstrating problem in IE: http://test.hmedicine.com/shopping/catalog/kits CSS: .tb{font: 8pt verdana;vertical-align:top;margin-top:0;margin-bottom:0;font-weight:bold} HTML: <span class="tb"> Homeopathic Medicine Shop </span><a href="/shopping/catalog"><img src="/shopping/pics/topbar1shopping.gif" alt="shopping" border="0"></a><a href="/news/guide/guide.php"><img src="/shopping/pics/topbar2.gif" alt="guides" border="0"></a><a href="/shopping/service"><img src="/shopping/pics/topbar3.gif" alt="customer care" border="0"></a><a href="http://www.forum.hmedicine.com/index.php"><img src="/shopping/pics/topbar4.gif" alt="user forums" border="0"></a><br> <table width="720" cellpadding="0" cellspacing="2" bgcolor="009999"> Thanks so much in advance. If it's hard to follow, i can post screenshots. |