CSS - Unwanted Right Margin Space In Ie
Hi there,
I'm building a page that requires 100% width & height, and absolutely NO margins on any side. I've applied the following inside my CSS: body { margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: 000000; } For this to work in Firefox, I've also had to add the same code just above the head tag (inconvenient, but I don't mind). My problem is the unwanted right margin that appears in IE. I have no idea how to remedy this. You may view the page here. Thanks so much! Similar TutorialsPlease look at http://certified.tmhdesign.com/know.asp in FF I have a div element with an id of "know" that is appearing under an h1 element with an id of know_header In Firefox there is an unwanted top margin on the div#know (or a bottom margin on the H1 element). I can't seem to understand why? T Heya guys, Hope someone can help me with this one. Been looking around the web but most are suggesting to do what i have already done. I've got this in style.css file: Code: /* SEARCH Bar */ .lb_bl {background: url(/img/lb_bl.gif) 0 100% no-repeat #E5ECEC} .lb_br {background: url(/img/lb_br.gif) 100% 100% no-repeat} .lb_tl {background: url(/img/lb_tl.gif) 0 0 no-repeat} .lb_tr {background: url(/img/lb_tr.gif) 100% 0 no-repeat; padding: 3px} .clear {font-size: 1px; height: 1px} .topform { position: absolute; right: 5px; top: 65px; width: 300px; font-size: 10px; font-family: myriad, verdana, sans-serif; text-align: right; } input, form { font-size: 11px; font-family: myriad, verdana, sans-serif; margin-bottom: 0px; margin: 0px; } /* End of SEARCH Bar */ Which refers to this part of my index.php page: Code: <!-- Top right SEARCH --> <div class="topform"> <div class="lb_bl"> <div class="lb_br"> <div class="lb_tl"> <div class="lb_tr"> <form name="form" id="form" method="post" action=""><input name="search" type="text" /> <input name="search" type="button" value="SEARCH" /></form> </div> </div> </div> </div> <div class="clear"> </div> </div> <!-- End of top right SEARCH --> But i am still getting a space below the form in IE (firefox is perfect). What should i do? You can see an example of the page at www.theresortwarehouse.com Thanks in advance to anyone who can help - Gaz Hi everyone. I have a header image and directly below it the div that holds my navigation. In FF it works great, but in IE I get about a 5px space inbetween the header image and the navigation div. The navigation div is colored so it's really easy to tell where it stops and starts in IE. Here's my CSS code: Code: body { background-image: url(images/bgshadow.gif); background-repeat: repeat-y; background-position: 50% 0; text-align: center; margin: 0 0; padding: 0 0; } #content { width: 738px; margin-top: 0; margin-right: auto; margin-bottom: 0; margin-left: auto; padding: 0 0; vertical-align: top; } #header { width: 738px; margin: 0 0; padding: 0 0; } #nav { width: 738px; height: 25px; margin: 0 0; padding: 0 0; background-color: #86462F; vertical-align: top; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; color: #fff; } #nav ul { width: auto; float: right; margin: 5px 0 0 0; padding: 0 0; } #nav ul li { margin: 0 25px 0 0; padding: 0 0; list-style-type: none; display: inline; } and my markup: Code: <div id="content"> <div id="header"> <img src="images/header.jpg" width="738" height="100" /></div> <div id="nav"> <ul> <li>Home</li> <li>Register</li> <li>Go Play!</li> </ul> </div> I've tested the white-space bug in windows IE (taking out all of the white-space in the markup) but that only had a marginal effect on the list. Does anyone have any ideas? Thanks, -Brian Hello, im working on styling an unordered list into a file tree. So far, so good. However, do you see that space that is showing in between each <li>, between the T (elbow2.gif) image, its very unwanted. Code: /* -- FILE BROWSER -- */ #browseFiles { padding: 0 0 0 20px;/* 000pix handles indent */ } #browseFiles ul { font: 10px sans-serif; color: #000; list-style:none; margin: 0; padding: 0; } #browseFiles li { /*display:compact; height: 18px;*/ padding: 0; margin: 0; } #browseFiles .fileDiv { height: 18px; background: url(images/elbow2.gif) no-repeat scroll 0 0; } #browseFiles .fileLink { padding: 0 0 0 13px; margin: 3px 0 0 0; } #browseFiles .dir { list-style:none; font: bold 10px sans-serif; margin:0; padding:0; } #browseFiles .file { padding: 0 0 0 3px; margin:0; } Heres the html Code: <div id='browseFiles'> <ul> <li class='file'> <div class='fileDiv'> <a class='fileLink'> <img class'fileIcon' src='images/file.gif' /> </a> </div> </li> <li class='file'> <div class='fileDiv'> <a class='fileLink'> <img class'fileIcon' src='images/file.gif' /> </a> </div> </li> <li class='file'> <div class='fileDiv'> <a class='fileLink'> <img class'fileIcon' src='images/file.gif' /> </a> </div> </li> </ul> </div> Thank you for the help in advanced. So I'm working on a new css-based design for my site and everything looks great.. until I open it in IE. I'm using rounded corners in 2 div boxes placed both on the top and bottom of my <div> body, they are both positioned correctly. The rounded images are used as background images in the <div>'s and not as an <img>. Problem #1: There is either a margin or padding that is separating the first and second <div> containers that make up the top and bottom rounded corners. I've tried *{margin..padding:0} to eliminate it from all elements (to no avail). Problem #2: I've set each <div> container used for the rounded corners to 12x12px, because that is the size of the image (rounded corner image). For some reason, in IE both containers are bigger than 12px in height, no idea why this is. In Firefox everything is working as it should, anyway here is the.. HTML: Code: <html> <head> <title>P_TITLE</title> <link href="skin.css" rel="stylesheet" type="text/css"> </head> <body> <div id="tlcorner"></div><div id="trcorner"></div> <div id="divbody"> <div style="float:left;width:75%"><div id="logindiv"></div><br><div id="searchdiv"></div></div><div id="logo">logo..</div> </div> <div id="blcorner"></div><div id="brcorner"></div> </body> </html> CSS: Code: html { height: 100%; margin: 0px; padding: 0px; } body { background-color: #CFCFCF; margin: 3px; padding: 0; } #logindiv { background-color: #FFF000; float: left; width: 100%; height: 120px; } #searchdiv { background-color: orange; float: left; width: 100%; height: 35px; } #logo { background-color: #000000; float: right; width: 155px; height: 155px; } #divbody { background-color: #FFFAF0; height: 700px; padding-left: 12px; padding-right: 12px; } #tlcorner { background-color: #FFFAF0; background-image: url(images/tl_corner.gif); background-repeat: no-repeat; background-position: top left; float:left; width: 12px; height: 12px; margin:0px; } #trcorner { background-color: #FFFAF0; background-image:url(images/tr_corner.gif); background-repeat: no-repeat; background-position: top right; height:12px; } #blcorner { background-color: #FFFAF0; background-image: url(images/bl_corner.gif); background-repeat: no-repeat; background-position: bottom left; float:left; width: 12px; height: 12px; } #brcorner { background-color: #FF0000; background-image:url(images/br_corner.gif); background-repeat: no-repeat; background-position: bottom right; height: 12px; } I'm sure if you use any image that is 12x12 you should see the same problems I am getting. Notice the padding or margin on the top left <div> element, and the incorrect height for both. Thank you very much for any suggestions. EDIT: Realized this is not an HTML issue. If a mod could move this to the CSS forum I would appreciate it. Thanks Please take a look at this page: http://www.4xp.net/template2/ I cannot get the space under the horizontal nav bar to go away. It has to do with the image links, because if I remove then and put plain text in there, that space goes away. It only happens in IE, the space isnt there in FF. Here is my css PHP Code: body { margin-top: 5px; margin-bottom: 5px; background-image: url('images/bg.jpg'); } #header { width: 900px; height: 90px; padding: 0; margin: 0; text-align: left; background-image: url('images/header_bg.jpg'); } img { padding: 0; margin: 0; } #menu { border-top: 1px solid #003366; border-bottom: 1px solid #003366; width: 100%; height: 25px; background: url('images/menu_bg.jpg'); background-repeat: repeat-x; text-align: left; } .menulink { margin-left: 20px; height: 25px; } #page { width: 900px; border: 1px solid #000000; text-align: center; margin-left: auto; margin-right: auto; } #status { width: 900px; height: 25px; vertical-align: middle; font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #003333; margin: 0; padding: 0; border: 0; } Any help would be very much appreciated. Thanks everyone! 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. It seems the form that creates unwanted space in IE. Site in question: http://www.phaseninedesign.com/p/uber/ HTML: Code: <div id="topMenu"> <form action="#" method="post"> <div id="reviewsBut"><a href="#"><img src="images/reviewsBut.gif" alt="Reviews" /></a></div> <div id="articlesBut"><a href="#"><img src="images/articlesBut.gif" alt="Articles" /></a></div> <div id="aboutBut"><a href="#"><img src="images/aboutBut.gif" alt="About" /></a></div> <div id="contactBut"><a href="#"><img src="images/contactBut.gif" alt="Contact" /></a></div> <div id="sponsorsBut"><a href="#"><img src="images/sponsorsBut.gif" alt="Sponsors" /></a></div> <div id="loginButTop"><a href="#"><img src="images/loginButTop.gif" alt="Sponsors" /></a></div> <div id="passwordBoxTop"><input type="password" id="password" onFocus="if(this.value=='password')value=''" onBlur="if(this.value=='')value='password';" value="password" /></div> <div id="userTopBox"><input type="text" id="user" onFocus="if(this.value=='Username')value=''" onBlur="if(this.value=='')value='Username';" value="Username" /></div> </form> </div> ----------------------- CSS: Code: #topMenu{ width: 1005px; height: 23px; margin-left: auto; margin-right: auto; background-color: #282a1d; background-image: url(images/topMenuBG.gif); border-right: 1px solid black; border-left: 1px solid black; } I've tried moving the form outside of the dive that its in, but that makes the space even bigger. When I browse the website with internet explorer, in the search section, there is a space after the form area. How can I remove it? http://www.refinethetaste.com/html/ 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> I have a couple of divs at the very top of my page spanning the width of the page. In IE-8 the page is displayed as I would like, with no spacing at the top margin above the first div. In FF, there is a giant space about 50 px high. I need to get rid of this space. Below is my css for the top-most div, body, and the html... any ideas? Code: body { margin-top: 0px; font-family: Arial,Verdana,Helvetica; font-size: 12px; } div#top { margin-top: 0px; float: left; background-image: url(../img/logo.png); background-repeat: no-repeat; width: 100%; height: 42px; } <div id="top"></div> <div style="margin-bottom:40px"> <script type="text/javascript">javascript menu code</script> </div> It's probably something small, something stupid, but I can't seem to scoot the different entries closer to one another. http://projects.describe.org/esdcar/directors.html http://projects.describe.org/esdcar/board.css with the relevant part being Code: .identitydir { margin: 0em; } .identitydir img { width: 100px; height: 100px; } .identitydir#top { margin-top: 1em; } .identitydir p { text-align: left; position: relative; top: -100px; left: 105px; width: 80%; } .identitydir h3 { text-align: left; position: relative; top: -100px; left: 105px; } I'm about ready to use a table instead. I normally don't use css outside of font formatting and one website I positioned with css (fixed width), but I'm integrating punbb with a website, and I'd like to stay with the css positioning. I'm trying to make 3 columns with margin space in between that add up to 100% width inside the page margins, and the columns should stay next to each other when the page is adjusted smaller, instead of falling beneath. I can get 3 columns, but they don't add up correctly to the fill width of the page (either wider or narrower, but never perfect), and they do the stacking, or falling beneath, even before the text in the columns get squished when I adjust the browser size. I'm a little better off if I try it outside of the punbb template, but its still wrong and has the same problems, just to a lesser degree. Does anyone know of a way to do this that doesn't rely on a complete template, so I can easily drop it into the punbb template? From what I've read, this looks to be quite a challenge with many hacks and such. As a css novice, would it be better to just complete this with tables? Here is where I'm going so far: Code: #oneBox { FLOAT: left; margin-bottom: 2px; PADDING-LEFT: 2px; PADDING-TOP: 1px; PADDING-BOTTOM: 1px; width: 33%; border: solid #000000 1px; BACKGROUND-COLOR: #2A3D5C; COLOR: #fff } #twoBox { FLOAT: left; margin-left: 1%; margin-right: 1%; margin-bottom: 2px; PADDING-LEFT: 5px; PADDING-TOP: 1px; PADDING-BOTTOM: 1px; width: 29%; border: solid #000000 1px; /*border-top: 0px; border-right: solid #000000 0px; border-left: solid #000000 0px; border-bottom: solid #000000 0px;*/ BACKGROUND-COLOR: #2A3D5C; COLOR: #fff; overflow: hide; } #threeBox { FLOAT: left; margin-left: 0px; margin-bottom: 2px; PADDING-LEFT: 5px; PADDING-TOP: 1px; PADDING-BOTTOM: 1px; width: 33%; border: solid #000000 1px; /*border-top: 0px; border-right: solid #000000 0px; border-left: solid #000000 0px; border-bottom: solid #000000 0px;*/ BACKGROUND-COLOR: #2A3D5C; COLOR: #FFF; } ...and the HTML Code: <div id="oneBox"> First thing </div> <div id="twoBox"> Second thing </div> <div id="threeBox"> Third thing </div> I know there are some odball things in there from trial and error, but it should be a good example of where I'm at. I do need to finish this soon, and I've spent all day trying to work these three columns, so if it's the opinion that I'd be better off with tables, I'm good with that too. Thanks up front for any replies! I'm *very* new to CSS and to these forums, I'm glad I found them. I'm hoping someone can help me with this problem I'm having. I added a table to this page and there are gaps under each word in each cell of the table. I added the same table to it's own page and the table shows up the way I want it but it won't on the page where CSS is used. It seems as if something in the CSS code is causing the gap under the words. Would anyone know why this is happening and how to fix it? I'm using IE 6 and haven't used any other browser yet to view the pages. Here is my css file http://debsdesignandhosting.com/layout.css in case it's needed. Thanks for any help I thought I should also say, it's not my intention to spam the forum with the info seen in the table. This is a new site not even live yet. This gap problem has me stumped Deb 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? Background info: - I have validated the page and CSS, no problems there - Site is working properly in Firefox and IE, seems to be a margin issue in Safari -This margin issue is not the common Safari bug with a negative margin being applied to a floated element -I am using Safari in a windows environment, I do not have a Mac The problem: -in Safari the top margin on the content either is either not being applied at all or is being interpreted differently -it may be of note that I was having the same issue with IE, but was able to specify an IE specific style sheet for it, I don't believe this is possible in Safari? The website: http://www.lisa-noble.com/test/redo.html 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>Site Test</title> <link rel="stylesheet" type="text/css" href="redo.css" /> <!--[if IE]> <link rel="stylesheet" type="text/css" href="iespecific.css" /> <![endif]--> </head> <body> <div id="top_filler"> </div> <div id="left_filler"> </div> <div id="right_filler"> </div> <div id="top_left"> </div> <div id="header"> </div> <div id="top_right"> </div> <div id="content"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> <p>Etc, etc, etc....</p> </div> <div id="bottom_filler"> </div> <div id="bottom_left"> </div> <div id="bottom_right"> </div> </body> </html> The CSS Code: * { margin: 0; padding: 0; } body { background: #fdd9e9; } div#top_filler { background: url(images/bg_slice_sm.png) repeat-x; width: 100%; height: 164px; position: fixed; top: 0px; z-index: 5; } div#left_filler { background: url(images/left_slice_sm.png) repeat-y; width: 174px; height: 100%; position:fixed; left:0px; z-index: 5; } div#right_filler { background: url(images/right_slice_sm.png) repeat-y; width: 161px; height: 100%; position:fixed; right: 0px; z-index:5; } div#bottom_filler { background: url(images/bottom_slice_sm.png) repeat-x; width: 100%; height: 76px; position: fixed; bottom: 0px; z-index: 5; } div#header { position: fixed; top: 0px; left: 37%; height: 125px; width: 316px; margin: 0 auto; background: url(pink_logo2.png) no-repeat; z-index: 25; } ul.NoBulletNoIndent { list-style-type: none; margin-left: 0px; padding-left: 0px } div#top_left { height: 314px; width: 221px; background: url(images/left_top_corner_sm.png) no-repeat; position: fixed; top: 0px; left: 0px; z-index: 5; } div#bottom_left { height: 175px; width: 176px; background: url(images/left_bottom_corner_sm.png) bottom no-repeat; position: fixed; bottom: 0px; left: 0px; z-index: 5; } div#top_right{ height:174px; width:174px; background: url(images/right_top_corner_sm.png) top no-repeat; position: fixed; top:0px; right: 0px; z-index:5 } div#bottom_right{ height: 602px; width:198px; background: url(images/right_bottom_corner2_sm.png) bottom no-repeat; position: fixed; bottom: 0px; right: 0px; z-index: 5 } div#content { margin: 40px 164px 0px 180px; position: relative; z-index: 1; } Hi! Should I do this? p { margin-top: 2em; margin-bottom: 2em; } or this: p { margin-bottom: 2em; } Same question for headers (h1, h2, etc) Thanks! Hi all Take a look at this in Firefox and then in IE7: http://www.josh.ch/files/temp/ie7_margin_bug/formulare.html The text input and the textarea fields have a strange margin on the left in IE7 that shouldn't be there. It seems to be "inherited" by the outher paragraph, just change the value in css/general.css on line 29 to see it happen. FF and IE6 behave well, IE7 doesn't. Interestingly, the select field (and all the other fields like radio buttons and checkboxes) don't have this problem. I did a search and found this link: http://www.positioniseverything.net/explorer/floatIndent.html Seems to be something like that, but the display:inline fix didn't help. the only way I see is a minus margin for the text input and textarea fields for IE7 only, but maybe there's a cleaner way? Thanks a lot for help :-) Josh Hi there, I have recently stumbled about a problem I had with another website I made as well, but since it was at the very bottom back then I kinda ignored it. My new website has this right in the header though, and so I decided to ask for help. Works perfectly in Gecko based browsers, though. I have the problem that I have to Div's right after each other which both have a top and bottom margin of zero, but there is a visible gap between them, only in IE though (header and content as well as content and footer) and in Opera 7.54 at the very bottom. The colors of the background PNG are also broken in IE, never mind that, will exchange that with a JPG. Website in question is http://cyxxon.com, WordPress with my own template. Had the same problem with a website completely handcoded by me. Any ideas? Thomas |