CSS - Mysterious Vertical Space
I have a region with a div, an image and another div stacked vertically. For some reason, there are a few pixels of blank space between the image and the bottom div.
http://www.brucethorn.com/index.php...maritime-sunday On another page, I have regions with a "line-height + vertical-align:middle" centering of an image that make up thumb nails. There too is a few pixels of blank space, but at the top and images, pushing them down and slightly outside of the div that contains each of them. http://www.brucethorn.com/index.php/paintings I suspect these are the same problem, but I could be wrong. The issue is most visable in FF, and noticable in Opera. I only see something sporadic for the second occurence in IE Code: body {background-color:#999999; margin:0px; padding:0px; border:0px; text-align:center; font-family:"Courier New", Courier, mono;} h1.header {height:16px; width:800px; _width:776px; font-size:100%; font-weight:bold; margin:0px 0px 0px 24px; text-align:left; background-color:#333333;} h2.header {margin:0px; font-size:90%; font-weight:bold;} div {text-align:left;} h2.infoleft {text-align:left; height:16px; width:576px; font-size:90%; margin:0px 0px 0px 24px; _margin:0px 0px 0px 12px;float:left;} h2.inforight {text-align:right; height:16px; width:176px; font-size:90%; margin:0px 24px 0px 0px; _margin:0px 0px 0px 0px;float:left;} div.black {background-color:#000000; color:#999999;} div.block {margin:8px 24px 8px 24px; text-align:justify; font-size:90%;} div.block2 {margin:8px 0px 8px 12px; _margin:0px 0px 0px 4px;} div.block3 {margin:8px 0px 0px 12px;} img {border:0px; margin:0px; padding:0px;} img.left {float:left;} img.right {float:right;} div.bar {height:16px; width:auto; text-align:center;} div.title {height:48px; width:800px; margin:auto;} div.content {height:392px; width:800px; margin:auto; text-align:center;} div.subbar {height:16px; width:800px; background-color:#333333;} div.menu {height:18px; width:480px; float:left; margin:30px 0px 0px 20px;} div.copyright {height:16px; width:800px; margin:auto; text-align:right; font-weight:bold; font-size:75%;} div.scroll {height:344px; width:800px; margin:8px 0px 0px 0px; overflow:auto;} div.filmunit {height:128px; width:128px; border:4px; border-style:solid; border-color:#000000; background-color:#999999; margin:8px; padding:0px; float:left; text-align:center; line-height:128px;} img.filmimage {vertical-align:middle;} Similar TutorialsMy site I am redesigning this site for a theater camp company. I want to create the effect of stage lights shining with a image rollover and am partly there. I am stuck now because I want to use an HR as the cross beam with images of stage lights directly below (take a look at the site to understand). I do not know how, or if it's possible, to line up the images directly below the HR (bar) so there is no space at all. Any help? i have two divs on top of eachother with images in each. there is a space i can't get rid of in IE..looks perfect in firefox. i've tried cutting out the margins and padding to no avail. seems like ie regularly has spacing problem from google searches but none of their fixes have worked yet. This is my first css based site...i'm having a nightmare time and wonder why this is so much better than tables when its taking me 4 hours in css what takes me 5 minutes with tables? that being said if you go he www . chhs . unh . edu / v3 . html on the right side here is the issue: in FF the contained divs are larger than the containing div in IE there is like 20 pixels of space at the top of the first containted div here is the code for this section, the sidebar is the container and the other 2 are the divs inside, quicklinks is the first one. Code: .twoColFixRtHdr #sidebar1 { width: 300px; float:right; text-align:left; background-color:#00F; padding:0px; display:inline; line-height:100%; } div#quicklinks{ display:block; width:300px; margin: 0px 0px 0px 0px; background-image:url(/images/v2/quicklinks_bg.png); background-position:top right; background-repeat:no-repeat; background-color:#AEAE5D; padding: 5px; color:#FFF; vertical-align:top; } div#photo_gallery_links{ width: 300px; margin: 10px 0px 0px 0px; background-image:url(/images/v2/photosbg.png); background-position:top right; background-repeat:no-repeat; background-color:#283C6F; padding: 5px; color:#FFF; } can anyone help me? i haven't used a board like this in like 8 years so i'm sorry if i'm doing it wrong. thanks! I'm going through hell trying to make a site look the same in IE and Firefox. The biggest problem is the gaping spaces IE adds between elements. What is the best way to fix this? Example at patrolmag.com/new. Any advice or help would be most appreciated. P.S. How the page looks in Firefox 3 is ideal. I just need to make at least IE7 come somewhere close to matching it. Hi, I'm trying to avoid using absolute positioning (and using a margin or padding) to vertically place two divs. clear:both seems to be close but it clears double the amount of space that I want. 1. What determine's how much space is cleared? 2. Is it a problem that neither of the divs is floated? http://www.sabahseaside.com/sti/testindex.php Code: #homecontent { position:relative; margin:10px; } #homecontent p { text-align:justify; margin:0 1em 2em; } .hometop { margin:0; padding: 0; border: 1px solid black; } .homebottom { margin:0; padding: 0; border: 1px solid black; clear:both; /*margin-top:4em;*/ } http://www.sabahseaside.com/sti/layout.css Oh yeah, and the images in those divs are floated! AHHH! I am trying to style a css layout. I keep getting a vertical space between two different block containers. here is the html: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title></title> <meta name="keywords" content="" /> <meta name="description" content="" /> <link href="default.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="wrapper"> <div id="header"> <div id="menu"> </div> </div> </div> </body> </html> Here is the CSS: Code: #wrapper{ margin: 0 auto; width: 977px; } #header { margin: 0; background: url(images/header_01.jpg) no-repeat 0 0; width: 977px; height: 198px; } #menu{ margin: 0; background: url(images/header_02.jpg) no-repeat 100% 0; float: left; width: 977px; height: 44px; position:relative; top: 100% } My theory: the top part of the header is 154 px tall. The bottom part is 44px tall. That makes 198px height. so with header being 198px tall, and the smaller image with a relative position 100% down from the top should correctly line up the two images. But yet I have a HUGE gap?!?! Why? Even if I put 154px instead of 100% for top ... it will not line up correctly. How do I reduce the vertical space between form elements that I put inside a div? I have text "username" with the textbox below it but there is like 25 pixels of vertical space between them. Brad I am trying to style a form using CSS instead of tables but am getting unwanted space above form elements when i use float:right to position them to the right of the prompt text. I have spent some time reading about the problem which appears to be an error with IEs rendering of CSS. I have tried several solutions posted on the web with no success. Can anyone recommend a solution to my problem. Thanks. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <style type="text/css" media="screen"> .form { font-size:10px; text-align:left; } .form input { width: 100px; font-size: 9pt; border: 1px solid #891C46; margin-left: 12px; padding-top:0px; float:right; } .form select { width: 100px; float:right; font-size: 9pt; border: 1px solid #891C46; } .form textarea { width: 100px; float:right; font-size: 9pt; border: 1px solid #891C46; } .form li{ list-style-type: none; clear:both; } .form img{ padding-top:10px; float:right; } </style> </head> <body> <table cellpadding="0" cellspacing="0" width="500"> <tr> <td width="50%" valign="top" class="form"> <ul> <li>Your name:<input name="textfield" type="text"></li> <li>Your email address:<input name="textfield" type="text"></li> <li>Your company:<input name="textfield" type="text"></li> <li>Your position:<input name="textfield" type="text"></li> <li>Subject:<select name="select"><option>Digital Advertising</option></select></li> <li>Query/comment:</li> <li><textarea name="textarea" cols="20" rows="8"></textarea></li> <li><img src="/carlton-newsite/img/contactus/send.gif" name="send" width="50" height="25" id="send"></li> </ul> </td> <td valign="top">sfasfasfasdfasdfasdfasdf</td> </tr> </table> </body> </html> Argh. Tried a number of variations on this probably simple task. Nonetheless: In this example how do I get the 'sidebar' to fill the vertical space of the container, and ensure the 'footer' remains positioned at the bottom (which it currently does) http://www.mandgweb.net/css_test/css_test.html Thank you Please poke around this site - http://swansonre.tmhdesign.com/home-payment-calculator.asp See the main content area (in white). It should butt up to the green navigation area but instead I get a gap for some reason or another. I've dissected this page up and down, left and right, but can't find what is causing the issue. If you browse some other pages you will see they are just fine. Thanks so much. T Hi, Does anyone know how to veritcally align text using CSS? like <tr valign='middle'> when using tables. My page is on: http://www.3003online.com/demos/ecoceylon/v2/ You can see a difference in the "Home - About Us - Products - Contact Us" links when viewing from IE and Mozilla Firefox. Basically, I would like the text to be centered vertically in the bar... but CSS by default puts it on top. I tried adding padding,which helped in IE... but Firefox still shows the links a bit higher than they should be.,... any ideas how to fix this? Also, a different problem in case anyone knows how to fix it... you can see a small brown bar on the top bar. It is 50px in height. But I have no idea how to make its width as wide as the remainder of the page (this would change with different resolutions). The main content of the page is 760px wide. I would like a brown box next to that, which is 50px in height and the remainder width. Any ideas? "width: auto;" doesn't work unfortunately [ this is a follow up to my previous thread http://forums.devshed.com/showthread.php?t=270438 Any help would be greatly appreciated. Thanks very much. Um... OK so I wrote a post asking if anybody knew why something was displaying incorrectly on my site, but due to forum rules I wasn't allowed to include any links. So how can I show you the problem if I can't show you? Also, the link saying "see forum rules for more information" didn't have any more information. Like, how many posts until I can ask for help and actually show what the problem is? 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 just don't understand IE... something that should work just doesnt, and then it works fine on another page.... for example... Scroll Over The Staff Links at the very bottom You will notice that the black background disappears when viewed in IE... but take a look at the code isolated in IE and it looks perfect... Hi, folks. I'm having a curious problem with the navigation on my page. I'd like the nav and header to be all on the same line. It works when I just include the nav icons as images directly in the HTML. But when I make the nav icons into links, set each link to display:block, and give it the appropriate background-image, it puts all the icons on a new line. I'm not sure why. Any ideas? You can see the page with the problem and the effect I'm trying to achieve at these two TinyURLs: Problem: TinyURL dotcomslash a8qnky Working: TinyURL dotcomslash 8tj29l (The HTML validates, and the CSS validates except for the IE PNG transparency fix. I'm still experiencing this problem without that fix in place.) Hi folks, my website section "www(dot)mail(dot)tssma(dot)net" has an extra blue bar at the bottom of the page even though i specifically set it to 900 with the following css. I actually dont know why its blue either. Code: body { background-image: url('http://www.tssma.net/templates/renrentemplate/images/Page-BgSimpleGradient.jpg'); top:0; width: 100%; height: 900px; Not only that i cant seem to change the Username and Password input which is currently grey, to black using the css. Help will be greatly appreciated EDIT: Hahah yay, i somehow got rid of the bar on the bottom just need help with the grey input fonts. I've been looking through many, many forums trying to resolve this issue, so please forgive me if there is a solution to this that I've missed. Here's the deal: On some installs of Firefox (4.0), the body is being positioned 28px lower than the top of the screen. I set the <html> tag to have a light blue background to troubleshoot the issue, and now there is a light blue bar across the top of the page, proving that it is the body of the page that is lower than it should be. I thought it was a Firefox "collapsing margin" issue, so I added "margin:0; to almost everything, and it didn't help. I'm trying to do this without having to absolutely position everything. Here's the site: www-dot-myportlandtours-dot-com here's the css: www-dot-myportlandtours-dot-com/wp-content/themes/myportlandtours/style.css Anybody have insight into this? |