CSS - Getting White Background To Be As Tall As The Contents
Hello, I have a container div with an id of "outer". This container holds 3 column divs, leftcolumn, rightcolumn and centercolumn.
The container CSS looks like this: Code: #outer{ padding:0px; margin-left:auto; margin-right:auto; width:755px; background-color:#FFFFFF; height:100%; z-index:1; background-image: url(images/common/whitebox.gif); background-repeat:repeat-y; } But for some reason, the container doesn't extend down to the length of the inner divs. Each column will vary in the future because everything is pulled from a database. Yet you can see the issue he http://www.caillouette.com/FriendsPHP2/index.php Any help, tips or tricks are appreciated. Thanks Similar TutorialsMisalignment - 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? So I'm having what I think are CSS issues with a site... I'm supposedly a "new user" though I've been registered for a long time, and just not used this account in a long time, so I can't show my URL's here... tried to abbreviate them... I'm not sure how to show you what the issues are if I'm not allowed to post URLs. Anyone with any suggestions there? This looks fine in IE, but not in Firefox. On (blocked) the main content that sits in the middle of the page sits in an 800px div called "page". I've set the background color for that to be white: FFFFFF, which Internet Explorer seems to understand. But Firefox seems to be leaving "page" to be transparent. This means that either the left div (content) or the right div (reef-job) ends when the content inside of it ends, rather than continuing down to the bottom of the "page" content. I'm not sure how to fix it for Firefox. Again, it's all the pages inside of (carrieandjonathan [dot] com /island-reef-job) and the stylesheet is at (carrieandjonathan [dot] com / island-reef-job / mt-island-reef-job.css) #page { width: 800px; margin: 0 auto; padding: 0px 0; background-color:#ffffff; } Any help is greatly appreciated. Thank-you in advance! Warmest, Jonathan I'm just trying to run an 8-pixel high blue bar across the top of my pages. Looks fine in Safari and Firefox. But appears to be 20+ pixels high in IE. Any ideas? Here's my CSS file. See #header. Thank you for your help! Code: * { font-style: normal; font-weight: normal; text-decoration: none; text-align: left; text-indent: 0; margin: 0; padding: 0 } body { color: #333; font-size: 1em; font-family: "Myriad Pro", "Myriad Web", "Lucida Grande", "Trebuchet MS", Tahoma, Helvetica, Arial, sans-serif; line-height: 1.5; background: #fff url("../images/back_scrabble_tiles.jpg") no-repeat left 9px; padding-right: 0; padding-bottom: 30px; padding-left: 0 } a { text-decoration: underline } a:link { color: #369 } h1 { font-size: 2.4em; letter-spacing: -0.05em; margin-top: 10px; margin-bottom: 20px } h2 { font-size: 1.8em; margin-top: 20px; margin-bottom: 20px } h3 { font-size: 1.2em; margin-top: 20px; margin-bottom: 20px } #header { background-color: #276da3; height: 8px; border-bottom: 1px solid #fff } #content { margin-top: 44px; position: relative; overflow: hidden } #maincontent { margin-right: 48px; margin-left: 450px } #maincontent h1 { font-size: 2.4em } #maincontent h3 { color: #276da3 } #maincontent b { font-weight: bold } #maincontent i { font-style: italic } #maincontent ul { padding: 20px } #maincontent #photo { float: right } #contactform { line-height: 1.2 } #sidebar { width: 404px; float: left } #sidebar #logo { padding-top: 240px; padding-bottom: 32px; padding-left: 32px } #sidebar #navigation { margin: 10px 0; padding: 0; width: 400px } #sidebar #navigation ul { list-style: none } #sidebar #navigation li a { color: #949576; font-size: 1.2em; font-weight: bold; text-decoration: none; background: #fff; text-align: right; display: block; padding: 8px 10px; height: 20px; border-bottom: 1px solid #e5e7cd } #sidebar #navigation li a:hover { color: #797a58; background-color: #ebecdd } #footer { margin: 24px 8% 12px 36%; padding: 12px 0; clear: both } #footer * { font-size: 0.9em; text-align: center } Greetings, I'm trying to implement a pseudo-modal dialog by layering the following: A div containing an iframe to be loaded with a form page A semi-transparent div to cover the entire underlying page, to prevent clicks on other elements The problem is that the cover div is only as tall as the viewport, which means that any page content in the scroll area below the viewport is left exposed. Below is the source. Any suggestions would be most appreciated! Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> <title>Test</title> <style type="TEXT/CSS"> html,body { margin:0; padding:0; height:100%; } #contactDiv{ z-index:2; display:none; position:absolute; top:100px; left: 50%; margin-left:-300px; border-style:solid; height:450px; width:600px; background-color:#ffffff; border-color:#666666; border-width:10px; } #modalOverlay{ z-index:1; display:none; position:absolute; top:0px; left: 50%; width:1008px; margin-left:-505px; min-height:100%; background-color:#000000; filter: alpha(opacity=30); -moz-opacity: 0.3; -khtml-opacity: 0.3; opacity: 0.3; } </style> </head> <body> <a onclick= "javascript:document.getElementById('modalOverlay').style.display='block'; document.getElementById('contactDiv').style.display='block';"> SHOW IT</a> <p> <div id=contactDiv> <iframe id=contactIframe width=600 height=450 scrolling="no" frameborder=0></iframe> </div> <div id=modalOverlay> </div> testing testing testing testing testing testing testing testing (The word "testing" was actually repeated multiple times -- enough to force scrolling on my laptop. I edited it for (relative) brevity.) </body> </html> This is a simplified version of the actual page. There's a menubar with a link that populates the div with the actual contact form. I cut out everything that didn't relate to the problem. Thanks, DM 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; } 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> 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 Ok, so I've finally made a design that I think looks OK, and the one last problem that I've come across is that IE(7) is adding some space at the edges of my divs, but it looks just how it should in Firefox: http://chipchamp.awardspace.com/webtemps Look at it in firefox and IE, and you'll see what I mean.. Here is the entire code for the page: Code: <html> <head> <style type="text/css"> body { background-image: url(images/design_5x1.gif); text-align:left; } div { border-width:0px; margin:0px; padding:0px; } #main-wrapper { background-color:transparent; width:800px; margin-top:50px; } #header { background-color:transparent; background-image:url(images/design_3x3.gif); width:800px; height:102px; } #content { background-color:#ffffff; width:100%; height:700px; } #menu { background-color:#ffffff; width:33%; float:left; } #content2 { background-color:#ffffff; width:60%; float:right; } #footer { background-color:transparent; background-image:url(images/design_7x2.gif); width:100%; } #footer-content { background-color:transparent; background-image:url(images/design_7x2.gif); width:680px; height:40px; } img.left { float:left; } img.right { float:right; } </style> </head> <body> <center> <div id="main-wrapper"><div id="header"><img class="left" src="images/design_3x2.gif"> </img><img class="right" src="images/design_3x6.gif"></img> <img class="right" src="images/design_3x5.gif"></img> <img class="right" src="images/design_3x4.gif"></img></div> <div id="content"><div id="menu"><img class="right" src="images/design_4x2.gif"></img></div> <div id="content2">hi again</div></div> <div id="footer"><img class="left" src="images/design_7x1.gif"></img> <img class="right" src="images/design_7x4.gif"></img><div id="footer-content">Copyright (c) 2008 ChipChamp Studios</div></div></div> </center> </body> </html> I have found out that if I comment out the background-image lines in #header and #footer, then the ugly white lines on the sides go away -- but so does some of the background image in the middle of the header/footer. So, does anyone have any idea how to fix this? It would be a great help! If you can fix the problem for either the header or the footer, I should be able to fix it for the other, so you don't have to fix both. Thanks! Does anyone know how to assure that checkboxes and their labels stay together? My situtation: I have several rows, each with several checkboxes. I want to assure that if a line wraps, each checkbox stays with its label (either each stay on the same line, or each move to the next, but never leave checkbox on one line and label on the next). I have tried several varients on: <span style= "whitespace: nowrap;". .... checkbox and label description... </span> or <label style= "whitespace: nowrap;". .... checkbox and label description... </label> even used both... have also tried a non-breaking space between label and checkbox control. <span> works on mac with Netscape, IE, Opera or Safari ... but alas it does not work on windows with IE 5.5 [unfortunately it acts as if 'nowrap' applies to the whole line, forcing viewers to scroll right to see all options] I can find documentation that says "white-space" can apply to <span> or <label>, and also documentation that says it can't. I guess the latter could explain the problem. But does anyone know how to keep the label and checkbox together thanx As a way to learn XHTML-Strict/CSS, I'm making a funny site with the goal of recruiting new people to be my friend. However, I can't seem to get rid of a horizontal bar of white space between the Title div and News & Content divs. I could fix it by making the News and Content positions absolute, but then I'd be unable to have a footer. Does anybody know why that white space exists, or better yet, how I can get rid of it? Site is http://www.kennygraham.net/index.html and CSS is http://www.kennygraham.net/perfect.css Thanks in advance to anyone who can help. 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. So this is my first time every going this in-depth with creating a website from scratch simply using CSS. So far with the help of many tutorials it's been really great. However, shortly after adding my layout to my code a problem arose. For a while it was okay. I started creating different containers and parts of the page. But then after one save this bar magically appeared. After ctrl-z'ing as far as I could and refreshing I could not find the problem. Here is a picture of the bar above the page: http://tinypic.com/r/124zv47/7 Here's the code: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <style type="text/css"> /*Currently not in use*/ .className { position: absolute; top: 0px; left: 0px; } /*Surrounding background cover*/ #outside_container { background: url(Slice.jpg); background-repeat: repeat-x; background-color: #000; min-height: 900px; } /*Actual background*/ #container { background: url(Complete_Layout.jpg); background-repeat: no-repeat; background-position: center; min-height: 900px; } /*Future sidebar*/ ul#navigationmenu { text-decoration: none; } body { margin: 0px; padding: 0px; } </style> </head> <body> <div id="outside_container"> <div id="container"> <ul id="navigationmenu"> <li><a href="#">Home</a></li> <li><a href="#">About Us</a></li> <li><a href="#">Contact Us</a></li> <li><a href="#">Competitions</a></li> <li><a href="#">Blog/Updates</a></li> </ul> </div> </div> </body> </html> I have applied the Twin Helix PNG fix http://www.twinhelix.com/css/iepngfix/ to a site I am building. The fix works on my PNGs apart from the PNGs having an ugly 1px white border around each of the transparent images. I have set the css img tag to the following: Code: } img { border: none; margin: 0px; padding: 0px; } However. The white borders still appear in Internet Explorer 6. Can anybody think of what might fix this problem? I have been trying to solve it for two days now. Thanks. 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! 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 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. 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 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; } |