CSS - <form> Tag Makes Unwanted Space
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. Similar TutorialsWhen 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/ 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. 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 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! 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. 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 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'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 hey What i want is to have one line with a select box and a submit button on it. But when i put those 2 elements in a form it takes up 2 lines. How can i make it so that the form wont require an extra line? Hi can anyone help me here, so I have a form on my page but after the </form> tag there is a big space below the last form element! Does anyone know some CSS i can use so I can get rid of this space? Thanks Hi, I'm creating a form and for some reason I can't get rid of the space between each line of the fields. I've tried making the margin and padding 0 but no joy. Is it me or just browser bugs? Help appreciated PHP Addict Code: <div style="width: 350px; float: right;"> <div style="width: 100px; text-align: right; float: left; background: yellow;"> <label for="">field Name:</label> </div> <div style="width: 100px; float: left; background: orange;"> <input name="Address1" type="text" id="Ad1" value="$Address1" size="15" maxlength="25"> </div> <div style="width: 120px; float: right; background: blue;"> Error Message </div> <br /> <div style="width: 100px; text-align: right; float: left; clear: left; background: yellow;"> <label for="">field Name:</label> </div> <div style="width: 100px; float: left; background: orange;"> <input name="Address1" type="text" id="Ad1" value="$Address1" size="15" maxlength="25"> </div> <div style="width: 120px; float: right; background: blue;"> Error Message </div> <br /> <div style="width: 100px; text-align: right; float: left; clear: left; background: yellow;"> <label for="">field Name:</label> </div> <div style="width: 100px; float: left; background: orange;"> <input name="Address1" type="text" id="Ad1" value="$Address1" size="15" maxlength="25"> </div> <div style="width: 120px; float: right; background: blue;"> Error Message </div> </div> 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'm having some trouble adding css code to my div well it works but when i try to copy the div and paste it right under it, it works (pic1) but ones i add the css code (pic2) they both stack on top of each other i used a site that convert psd's to css code thats how i got the code i have 0% css knowledge so i dont even know what my problem is called or else i would Google it so if any one can help or point me in the right direction would be highly appreciated thanks in advanced of course change $ for links to work htt$://i47.tinypic.com/2nuspe9.gif : div_preview_no_css htt$://i47.tinypic.com/28cdr2b.gif : div_preview_with_css htt$://ww$.megaupload.com/?d=LDKDTSHJ : div_code htt$://ww$.megaupload.com/?d=DGTIWKNX : css_code DIV CODE: PHP Code: <div id="tabs"> <div id="albumcoverimg"> <img src="{album_cover_url}" alt="albumcover" /> </div> <div id="titletext"> <p><h2>{artist_name}-{album_name}</h2></p> </div> <div id="descriptiontext"> <p><h3>{short_description}.</h3></p> </div> <ul id="infomenu"> <li>{album_price}</li> <li>Genres:<a href="http://#"><span style="color:#298CDA;">Hip Hop/Rap,</a><a href="http://#"><span style="color:#298CDA;"> Music,</a><a href="http://#"><span style="color:#298CDA;"> Latino</span></a></li> <li>Released: {month day, year}</li> <li><span>℗</span> {year : record_label}</li> </ul> <ul id="previewmenu"> <li><a href="http://#">{track_name}</a></li> <li><a href="http://#">{track_name}</a></li> <li><a href="http://#">{track_name}</a></li> </ul> <ul id="forummenu"> <li style="width:99.75%;"><a href="{forum_article_url}">Discuss in the Community</a></li> </ul> <div> <img src="/images/tabss/toprowimg.gif" alt="toprow" /> </div> <div> <img src="/images/tabss/btmrowimg.gif" alt="btmrow" /> </div> </div> CSS CODE: PHP Code: #infomenu li a, #previewmenu li a { padding-left: 0px; padding-right: 0px; text-decoration: none; width: 100%; display: block; } #previewmenu li, #infomenu li { width: 100%; display: block; margin: 0px; } #btmrowimg, #toprowimg { visibility: visible; position: absolute; left: 6px; z-index: 1; width: 540px; height: 23px; } #descriptiontext p { font: 12px/14px Verdana; margin: 0px; text-align: left; } #previewmenu li a { color: #000000; } #descriptiontext { visibility: visible; position: absolute; left: 212px; top: 96px; z-index: 1; width: 321px; } #forummenu li a { text-decoration: none; color: #000000; height: 100%; display: block; } #albumcoverimg { visibility: visible; position: absolute; left: 14px; top: 16px; z-index: 1; width: 189px; height: 189px; } #infomenu li a { color: #858989; } #forummenu li { height: 100%; display: block; float: left; margin: 0px; } #previewmenu { font: 14px/17px Verdana; margin: 0px; padding: 0px; list-style: none; text-align: left; position: absolute; left: 256px; top: 217px; z-index: 1; width: 284px; } #titletext p { font: 22px/26px Verdana; margin: 0px; text-align: left; } #titletext { visibility: visible; position: absolute; left: 212px; top: 21px; z-index: 1; width: 329px; } #toprowimg { top: 323px; } #forummenu { font: 12px/13px Verdana; height: 13px; text-align: center; margin: 0px; padding: 0px; list-style: none; position: absolute; left: 338px; top: 321px; z-index: 2; width: 202px; } #btmrowimg { top: 373px; } #infomenu { font: 12px/14px "Lucida Sans Typewriter"; margin: 0px; padding: 0px; list-style: none; text-align: left; color: #858989; position: absolute; left: 22px; top: 219px; z-index: 2; width: 190px; } #tabs { margin: 0px auto 0px 0px; width: 547px; } I am having a problem with IE. I have an anchor nested inside a list item with display: block applied. Because it is a block-level element (now), I applied a height. In Firefox/Win, it works wonderfully. In IE6/Win, the anchor area shrinks! If I leave it out, Firefox still works, but IE has gaps showing the background color of the body! I am okay with this problem since this page is for a friend, but I would like to know if there is a way to fix this for future reference. CSS: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <title>Choose a Page</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> /* <![CDATA[ */ body { font-family: arial, helvetica, verdana, geneva, sans-serif; font-size: 11.5pt; margin: 0; padding: 0; color: #fff; background-color: #000; } h1, h3 { text-align: center; } h2, #pgdesc, #img{ text-align: center; margin: 0; padding: 0; } ul { margin: 0 0.5% 0; width: 25%; float: left; height: 100%; padding: 0; border: 4px solid #009; border-top: 1px solid #009; list-style-type: none; list-style-position: outside; } li { background-color: #039; width: 94%; padding: 3%; margin: 0; border-top: 4px solid #009; } li a { background-color: #099; height: 1%; margin: 0; padding: 0 0 0 4%; display: block; font-weight: bold; } a { text-decoration: none; } a:link { color: #009; } a:link:hover { color: #00f; background-color: #0ff; } #active { background-color: #f0f; } /* ]]> */ </style> </head> <body> <h1>Directions</h1> <ul> <li><a href="index.html" title="E.T. Phone Home">Home</a></li> <li><a id="active">Directions</a></li> <li><a href="gbc.html" title="View GameBoy/GameBoy Color games">GameBoy/GB Color</a></li> <li><a href="gba.html" title="View GameBoy Advance games">GameBoy Advance</a></li> <li><a href="nes.html" title="View Nintendo/Famicom games">NES/Famicom</a></li> <li><a href="snes.html" title="View Super NES/Super Famicom games">SNES/Super Famicom</a></li> <li><a href="ggear.html" title="View Game Gear games">Game Gear</a></li> <li><a href="genesis.html" title="View Genesis MegaDrive games">Genesis/MegaDrive</a></li> <li><a href="32x.html" title="View 32X games">32X</a></li> <li><a href="psx.html" title="View PlayStation games">PlayStation</a></li> </ul> <h2>Select a page</h2> <div id="pgdesc">Select a console/handheld and then a letter of the alphabet to see the list of games for that letter.</div> <h3>Note: This page does not host ANY emulators. If you came here looking for an emulation site, you will not find anything.</h3> <div id="img"> <img id="atari" src="atari2600.jpg" alt="Atari 2600"> </div> </body> </html> Thank you to all who try to help! Hey everyone, I am doing some stuff to my site, and I noticed that when someone clicks a link, the text shifts sligtly to the left. I thought it would be the active border, but I am not sure. It is a small bug, but it is kind of annoying me. Here is my link code. Code: #main a:link { color: #41619a; padding: 0; } #main a:visited { color: #41619b; } #main a:hover { text-decoration: underline; } #main a:active { border: 0; } Here is one of the pages where it happens. Any suggestions on how to fix this? Hi, i made a page with DIVs and floats and all that and everything is peachy. i got myself an ecommerce solution, re-designed the interior to be tableless and now have a problem with IE that i cannot seem to get rid off. live example: www. chocolateriewanders.com/shop - the 3 floated images leave the div in IE (do not wrap) [thats the smaller problem] - if you click on 'Gift Boxes', then the content is moved down quite a bit opposed to the looks in Firefox, were its all aligned correctly. i tried to apply the holly hack - but i am not very comfortable with it. right now the 'shop' site does not validate and i have no idea why either (html validation) If someone could help me out, that would be great (and yeah i want to succeed in validation too! but this shop is pretty crazy put together and i have no clue about php and whatnot it utilizes .... btw, most pages are put together with php from a database and TPL files, which i can edit) title doesnt really explain it, but i cant really explain it well in 1 line. code I use is at bottom of the post but using the below code. If I take out the border-top declaration in #bodycontainer, it seems to lose the margin-top that is declared in the flashcontainer. when i say lose, the background-color of the bodycontainer no longer exists above the flashcontainer. it seems as the flashcontainer overlays the parent and moves up or whatever, if that makes any sense. this is in Firefox 3.0.3 code validates as transitional (and even strict if i change the doctype) i cannot figure out why either. i've used firebug to see if any CSS was overriding, but it doesnt seem to be any 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" xml:lang="en" lang="en"> <head> <title>Test</title> <style type="text/css"> <!-- body { margin: 0; padding: 0; } #bodycontainer { width: 960px; margin-left: auto; margin-right: auto; margin-bottom: 10px; background-color: #000; border-top: 1px solid yellow; /* remove this line */ } .flashcontainer { width: 950px; margin-left: auto; margin-right: auto; margin-top: 5px; border-top: 1px solid red; } --> </style> </head> <body> <div id="bodycontainer"> <div class="flashcontainer"> <img src="images/home_flash_area.jpg" width="950" height="240" alt="flash container" title="flash container" /> </div> <h2>Some Title</h2> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed doamet, consectetur adipisicing elit, sed do.</p> </div> </body> </html> 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 |