CSS - Floating Issues.
I am having problem layout out a series of spans in a row...
The code I am using should output: ITEM1 ITEM2 ITEM3 ITEM4 ITEM5 ITEM6 ITEM7 but it is outputting ITEM1 ITEM2 ITEM3 ITEM4 ............................................. ITEM5 ITEM6 ITEM7 It steps down a line when the drop down navigation makes an appearance. The code I have is: CSS: PHP Code: .textbox { position: relative; clear: right; float: left; padding-right: 17px; padding-left: 17px; border-right-width: 1px; border-right-style: solid; border-right-color: #DAEEAC; } a { color: #FF6600; } ul { padding: 0; top: 0px; list-style: none; } li { float: left; position: relative; width: 100px; } li ul { display: none; position: absolute; top: 2em; left: 0; background-color: #e7e7e7; } li > ul { top: 15px; left: 5px; } li:hover ul, li.over ul{ display: block; } HTML: PHP Code: <div id="navbackground"> <div class="navholder"> <table width="600px" height="15" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center"> <span class="textbox"><a href="index.php" class="navtext">Homepage</a></span> <span class="textbox"><a href="packages.php" class="navtext">Packages</a></span> <span class="textbox"><a href="booking.php" class="navtext">Booking</a></span> <ul id="nav"> <li><span class="textbox" style= "height:45px; width: 100px;"><a href="booking.php" class="navtext">Gallery</a></span> <ul> <li><a href="#">Ground Shots</a></li> <li><a href="#">Recent Events</a></li> <li><a href="#">Hen Parties</a></li> <li><a href="#">Lorem Ipmus</a></li> </ul> </li> </ul> <span class="textbox"><a href="contactus.php" class="navtext">Contact Us</a></span> <span class="textbox"><a href="links.php" class="navtext">Links</a></span> </td> </tr> </table> </div></div> Similar TutorialsSo I've tried to make my site www.thespinzone.com work for all browsers, but I'd settle for IE & Mozilla, however I have run into a big problem with IE (and it appears ONLY 7+) and Mozilla, all versions. First the IE problem is that it's adding a horizontal scroll bar on my main page, not the others, and I can only assume it has something to do with the RSS headlines positioning? screen shot 1 Now I'm having 2 problems with Mozilla: 1st: No matter how I try manipulate the CSS, the headlines won't float to the right, and they end up being squeezed next to my picture which is a waste of space and looks silly. Here is a screen shot of how it looks. Ideally I want the headlines to be on the right hand sight of the page, as far as it can be. I WANT the layout to look, MINUS the horizontal scroll bar like that first IE screen shot. 2nd: clicking or right clicking on any of the 'headline' items, moves that entire part underneath my picture and I have no idea why? In case it doesn't do that with your mozilla version, here's a screen shot The relevant CSS is on the index page so rather than me cut & paste it (unless that's preferred) then 'view source'..... I appreciate any and all help and advice. Thanks I cannot figure this out. I've tried adding clear: both in several places, I've tried overflow: hidden and I've tried cursing. Nothing works! How can this be fixed so that in IE6 the divs are not staggered vertically?? Code: <div style="height: 38px; margin: 0px; padding: 0px; width: 140px;"> <div style="float: left; height: 38px; width: 38px;"><img style="border: 1px solid #444444; vertical-align: middle" src="http://www.diversifieddesigns.com/GRAPHICS/Spacer.gif" alt="" width="38" height="38" border="0"></div> <div style="float: right; height: 38px; width: 102px;">copy</a><br>copy</a></div> </div> <div style="height: 38px; margin: 0px; padding: 0px; width: 140px;"> <div style="float: left; height: 38px; width: 38px;"><img style="border: 1px solid #444444; vertical-align: middle" src="http://www.diversifieddesigns.com/GRAPHICS/Spacer.gif" alt="" width="38" height="19" border="0"></div> <div style="float: right; height: 38px; width: 102px;"><img style="border: 1px solid #444444; vertical-align: middle" src="http://www.diversifieddesigns.com/GRAPHICS/Spacer.gif" alt="" width="38" height="8" border="0"></div> </div> Hey, I came across this forum and hopefully somebody can help me. Here is my website: http://www.jmuelectricmotorcycle.tk When the page is in firefox, If you page zoom out, the navbar goes under the content instead of staying on the right. I think it has something to do with padding and the sidebar not having enough room so it drops down. When I set the content to 1005 instead of 1000, it works, but there's a giant 5 pixel gap between my side bar and my content container. Also, does anybody know how to style called data from ssi.php in SMF forums? I want my login boxes to look like my main page. Thanks. Here is my css: Code: html { font: normal 12px verdana, arial; background-color: #000 } body { text-align: center } #fw-container { margin: 0 auto; width: 1000px; text-align: left } .hasSidebar #fw-container { width: 1000px; } a, a:visited { text-decoration: none; } a:hover { text-decoration: underline; } /* --- Header --- */ #fw-head { position: relative; height: 196px; background: #242424; } #fw-title { font: bold 26px verdana; letter-spacing: -1px; position: absolute; top: 20px; left: 20px; padding: 0; margin: 0; z-index: 10; } #fw-title a, #fw-title a:visited, #fw-title a:hover { color: #fff; } .fw-logo { width: 760px; height: 196px; position: absolute; } .hasSidebar .fw-logo { width: 1000px; } /* --- Navigation --- */ #fw-mainnavwrap { background: #242424; padding: 10px 20px; font-family: arial; font-weight: normal; border-top: 1px solid #000; border-bottom: 1px solid #000; } #fw-mainnavwrap ul { margin: 0; padding: 0; background: transparent; list-style-type: none; } #fw-mainnavwrap li { margin: 0px 15px 0px 0px; display: inline; } /* --- Content --- */ #fw-bigcontain { width: 760px; float: left; } .fw-paragraph { background: #242424 url('../Waveform/img/bg-p.gif') repeat-x top left; border-bottom: 1px solid #000; padding: 15px 20px 10px; overflow: hidden; } .fw-title { margin: 0px 0px 10px; font: 18px verdana; color: #fff; } .fw-text { margin-bottom: 10px; } /* --- Sidebar stuff --- */ .hasSidebar #fw-sidebar { width: 239px; float: right; font-size: 12px; clear: right; border-left: 1px solid #000; } #fw-sidebar .fw-title a, #fw-sidebar .fw-title a:visited, #fw-sidebar .fw-title a:hover { color: #fff; text-decoration: none; } #fw-sidebar .fw-title { font-size: 1.3em; font-weight: normal; } /* --- Footer --- */ #fw-footer { font: normal 10px verdana, sans-serif; background: #242424; margin: 0px; padding: 11px 0px 1px; color: #999; clear: both; width: 760px; } .fw-footertext { background: #161616; border-bottom: 1px solid #000; border-top: 1px solid #000; margin: 0px; padding: 6px 0px 6px 20px; } Hi, Can someone help me with why the following header bar doesn't work in Firefox? It just shows the very top of the bar with the two other divs inside of it. Code: <div class="cmsHeader"> <div style="float: left;">Page Name</div> <div style="float: right;"><a href="" title='Add Page'><img src='images/icons/file_(add)_16x16.gif' border='0' alt='Add Page'></a></div> </div> .cmsHeader{ background: #809096; padding: 5px; width: 98%; color: #FFFFFF; } .cmsHeader a{ color: #FFFFFF; text-decoration: none; } .cmsHeader a:hover{ text-decoration: underline; } I currently have the following layout Code: <table> <tr> <td></td> <td></td> </tr> </table> how do i go about making the same layout but using CSS. Each <td> is 50% wide Hi Everyone, I've been doing modest CSS for a while now and feel like I have a good grasp of it, and generally find a way of doing what I want. But, this has always bugged me and I need to understand what is going on... I think it's a question of Floating. This is in reference to http://www.arabellamusic.co.uk I want the blog posts to be on the left, and some other content on the right. How is the best way to go about doing this? You can check my source, but this was my thinking: Code: HTML <div class='inner'> <div class='left'> BLOG PHP HERE </div> <div class='right'> SOME OTHER STUFF HERE </div> </div> And the CSS: .inner { width:788px; } .left { float:left; width:50%; } .right { float:left; width:50%; } If you grab my stylesheet and my source, you will see that I have a couple more things in there, but I don't think they could be affecting the rest (text-align etc...) So, am I doing this wrong? I have floated columns in other websites this way and it sometimes works, sometimes doesn't. Incidentally, once it would only work when I set 49% to each, I was assuming this was something to do with the box model I read about, but wasn't too sure. I will try not to play around with the site too much until I get a reply or two, but a few things may jump around as I try stuff! Thanks in advance... James I have 3 tables in a div. I have two of the tables one on top of the other. I wanted to place the third table to the left of the bottom table. So I placed the second table relative and left -50px. I placed the third with position absolute, top -70px and float right to achieve this layout. Is there a better way of doing this out of curiousity? Learning CSS and trying to emulate the following table: Code: |--------------------------------------| | Text 1 |----------------| | | Text 2 | Inner box text| | | Text 3 |----------------| | |--------------------------------------| I can get a nested div to work vertically but not horizontally. I'm trying: Code: div#container { float: left } div#title { float: right } <div id="container"> hello<br>hello <div id="title"> Text 1<br /> Text 2 </div> </div> Which is producing: Code: |--------------------------------------| | Hello | | Hello | | |----------------| | | | Text 1 | | | | Text 2 | | | |----------------| | |--------------------------------------| Perhaps a positioning thing which I don't understand yet? It's not homework so you don't have to do it for me, but rather you could just point to knowledge sources.... Tx! hi, i am a total newbie with css and trying to create a floating divider. an example can be seen at www.payjunction.com. does anyone know a tutorial on how to create one? thanks for the help in advance I saw this appealing menu from a css contest page and i've studied the code over and over again but i can't seem to get the same effect as this person has done. He has created a menu that just floats while the screen is able to scroll up and down. the site is : http://contest.prestontalk.com/index/FluidFixed/0/4/1/ if anyone knows how this effect is done, let me know. thanks! I'm Having problems getting my footer to stay below the content of my page. here's the link to my page. http://www.netgamegurus.com/ main page html Code: <body> <div class="container"> <div class="header"> <?php include_once("pages/header.php"); ?> </div> <div class="main_body"> <?php include_once("pages/index_body.php"); ?> </div> </div> <div class="clearfooter"> </div> <div class="footer"> <?php include_once("pages/footer.php"); ?> </div> </body> </html> main page CSS Code: body { background-color: #FFFFFF; text-align:center; } body,html { margin: 0 0 0 0; padding: 0 0 0 0; height: 100%; width: 100%; } a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: underline; } a:active { text-decoration: none; } .container { position:relative; padding:0px; margin:0px; margin-bottom: -150px; width:100%; height:100%; background-color:#666; } .header { } main_body { } .clearfooter { clear:both; height:150px; } .footer { position:relative; height:150px; margin: -150px auto 0 auto; } index_body html Code: <body> <div class="left_col"> <?php include_once("left_col_index.php"); ?> </div> <div class="right_col"> <?php include_once("right_col_index.php"); ?> </div> </body> </html> index_body CSS Code: .left_col { position:absolute; padding:0px; margin:0px; top:175px; left:0px; width:150px; height:100%; background-color:#00F; } .right_col { position:absolute; padding:0px; margin:0px; top:175px; left:150px; width:857px; height:105%; background-color:#0C3 } I've looked up a ton of info on this on google, but nothing seems to help. Anybody got an idea on this? Hi, I'm getting very frustrated trying to float in image to the right and vertically aligned in a TD cell. This is a actually a vBulletin Forum Home Page and I want to display an image in the forum description. With the inline CSS below I keep getting a new line which I don't want. I want the text "Forum description goes here" with the image vertically aligned on the right hand side of the TD cell. Code: <td class="alt1Active" align="left" id="f34"> <div> <a href="http://www.myurl.co.uk/forums/test_forum/"><strong>Test Forum</strong></a> </div> <div class="smallfont"> Forum description goes here. <!-- *** THIS IS THE BIT I HAVE CONTROL OVER *** --> <div align="right" valign="top" style="float:right;"> <a href="http://www.myurl.co.uk"> <img src="http://www.myurl.co.uk/picture.jpg" style="border:0px;"> </a> </div> <!-- ****** --> </div> </td> Hi im experiencing big problems with creating this layout. I spent whole day with positiooning this divs but i cant do this final layout. Everytime i want to float divs to left DIV 1 and DIV 2 are ok but DIV 3 jump to new line under DIV 2 and dont fit the gap between DIV 3 and div 1 . Can someone please help me ? Thanks ... link to image : xipic.eu/ufiles/njf25uy8_divs.png hey I am trying to get this sub menu floating on the rollover of a list item. Here's my HTML: Code: <body> <div id="banner"> </div> <div id="leftmenu"> <ul> <li>List 1</li> <li><a href="">List 2</a></li> <li><a href="">List 3</a> <ul> <li><a href="">List 3.1</a></li> <li><a href="">List 3.2</a></li> <li><a href="">List 3.3</a></li> <li><a href="">List 3.4</a></li> </ul> </li> <li><a href="">List 4</a></li> <li><a href="">List 5</a></li> <li><a href="">List 6</a></li> <li><a href="">List 7</a></li> <li><a href="">List 8</a></li> <li><a href="">List 9</a></li> </ul> </div> <div id="maincontent"> CONTENT </div> </body> and this CSS: Code: #leftmenu { position: absolute; margin: 0px; top: 120px; left: 0px; width: 147px; height: 800px; background-color: #cccc66; font-size: 10px; font-weight: bold; } ul { padding: 0; margin: 0; list-style: none; } ul li { color: #FFFFFF; display: block; background-color: #FF0000; margin-bottom: 1px; text-align: right; font-weight: bold; } ul li a { text-decoration: none; color: #FFFFFF; } ul li a:hover { color: #000000; } ul li ul { display: none; position: absolute; top: 200px; left: 100px; } #maincontent { position: absolute; z-index: 0; left: 147px; top: 120px; height: 381px; width: 100%; padding-top: 10px; padding-left: 10px; margin-top: 0px; margin-left: 0px; background-color: #FFFFFF; font-family: Arial; font-size: 13px; } so yeah, I am struggling at this point, I have looked at a reference that someone gave me last time I brought up the issue, but can't get it working, if you can spot why, help would be appreciated, not having much luck, thinking maybe a syntax thing(?), not sure...HELP!! kr. The image below is how I want my website to look (div-wise, that is). It looks like this on all platforms and on all browsers except IE 5.0 and 6.0: IE 5.0 and 6.0 render the following: I have included my html + css code below. I have tried to make #sidenav float:left instead of float:right. This makes no difference for browsers but IE 5.0 and 6.0, which then again render the page wrong. Also decreasing the width of #sidenav (i.e. to 20px) doesn't help; the result is the same. Could somebody please help me fixing this There must be at least one css guru out there today All help is greatly appreciated! Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Test</title> <style type="text/css"> body { margin: 0; padding: 0; } #main { background-color: red; text-align: center; } #wrapper { text-align: left; margin: 0 auto; width: 300px; } #content { background: yellow; width: 200px; float: left; margin-left:50px; } #logo { background-color: lime; } #mainnav { background-color: pink; } #subnav { background-color: navy; } #text { background-color: orange; } #sidenav { background-color: blue; width: 50px; float: right; padding-top: 50px; } #footery { clear:both; background-color: #fff; } #footer { background-color: pink; margin: 0 auto; width: 200px; } #logo, #mainnav, #subnav, #footer { min-height: 30px; } </style> </head> <body> <div id="main"> <div id="wrapper"> <div id="content"> <div id="logo"><br><br></div> <div id="mainnav"><br><br></div> <div id="subnav"><br><br></div> <div id="text"><br><br><br></div> </div> <div id="sidenav">text</div> </div> <div id="footery"> <div id="footer"><br><br></div> </div> </div> </body> </html> Hello, can anyone help me with this? I'm having trouble floating some divs and I can't find the problem. 1. navigation should be aligned with the bottom of the h1 logo 2. the content div should come next to the list of brands. The content div should overlap the black bg at the top. www. claeysconsult . be / misskado / index2.html Thanks in advance... I'm having a weird situation. I've got a nested divs in a big box. Anyway, I've got one div floating an image on the left and another div with text on the right. Anyway, there's not much text, but under the img div there's a gap in IE7 but not in FF and I was wondering why. For some reason the margin-bottom: 5px; in the <h3> tag causes there to be the gap under the floating div holding the img. I'm wondering why this is happening in IE7 but not in Firefox. I created an example code to show what I mean and placed comments around the h3 tag that seems to be the cause. I put all the css in the html using style tags. I have a screenshot but it doesn't look like I can attach it. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <title>test</title> </head> <body> <!-- A big box to hold everything --> <div style="border-style: solid; border-color: #777777; margin-top: 10px; margin-bottom: 10px; width: 400px; padding: 0;"> <!-- the Image Div that holds the 100x100 pixel image and floats on the left in the big box --> <div style="float: left; width: 106px; height: 106px;"> <img src="test.jpg" alt="Picture of Test Image" style="display: block; width: 100px; height: 100px; border-style: solid; border-color: black; border-width: 3px; margin: 0;" /> </div> <!-- This is the text Div that holds an H3 heading Keep a 106px margin to prevent any later text from wrapping. Neither Removing the margin nor the padding HERE solves the problem only the margin-bottom in the h3 tag style seems to matter --> <div style="margin-left: 106px; padding-left: 10px; margin-right: 0; margin-bottom: 0; margin-top:0;"> <h3 style="margin-top:5px; margin-bottom: 5px; border-style: solid; margin-left: 0; margin-right: 0;">Test</h3> <!-- HERE'S THE QUESTION! why does the "margin-bottom: 5px;" leave a gap 5px gap underneath the image in IE7 but not firefox. Who's wrong? IE7 for putting the gap in or firefox for not floating things correctly? The H3 should be WELL away from the bottom of the div with most font sizes...Also oddly enough, enclosing the parent div of the h3 in a border removes the gap under the image BUT a border around the h3 itself does NOT Why the gap? --> </div> <!-- This div stops the floating --> <div style="clear:both; margin: 0; margin-right: 0; padding: 0; width: 0; height: 0;"> </div> </div> </body> </html> http://jordanmeeter.com/new/links.php If you view that page in Firefox, it displays how it is supposed to. But if you view the page in Internet Explorer, you can see that it is severely ****ed up! Any suggestions? Thanks, Jordan Hi All I seem to have an issue with floating an element in IE6&7. All other browsers (including IE8) are fine. When using a right float element, IE7 seems to push the elements to the left of it below the right-floated element, instead of to the left where they are suppose to be. Is there a work-a-round and/or hack for this? Cheers! Russ Hi Guys, Am farely new to CSS and was workin on a wordpress site. when I started getting this error ... Now what I want is three DIVs to be placed side by side on the same background image ... so I instill a wrap ... I want them to look something like this ... http://img244.imageshack.us/img244/8750/wantga3.jpg Here is the code am using .... Code: /* bottom page ================================================= */ #bottom { width: 1000px; background: #95A566 url("images/bottom.gif") repeat-x top left; } #wrap { padding-top: 3%; padding-left: 0; width: 1000px; } #wrap a:hover {color: #000;} #wrap ul { margin-left: 0px; list-style-type: none; } #wrap ul li { background: url("images/li_bottom.gif") no-repeat; padding-left: 25px; background-position: 0 0.4em; } .tools { padding-left: 25px; background: url("images/leaf2.gif") no-repeat top left; margin-top: 1.5em; } .left { width: 25%; float: left; margin-left: 10%; } #bottomnav li a span { display: none; } #bottomnav li a:hover span { display: inline; } .center { width: 25%; float: left; margin-left: 2.5%; } #bottomnav li a span { display: none; } #bottomnav li a:hover span { display: inline; } .right { width: 25%; float: left; margin-left: 2.5%; } And the Implementation .... Code: <div id="bottom"> <div id="wrap"> <div class="left"> <h3 class="tools">Recent Posts</h3> <ul> <?php get_archives('postbypost', 10); ?> </ul> <h3 class="tools">Toolshed</h3> <?php include (TEMPLATEPATH . "/bottomnav_menu.php"); ?> <?php include (TEMPLATEPATH . "/searchform.php"); ?> </div><!-- end left --> <div class="center"> <h3 class="tools">Recent Posts</h3> <ul> <?php get_archives('postbypost', 10); ?> </ul> <h3 class="tools">Toolshed</h3> <?php include (TEMPLATEPATH . "/bottomnav_menu.php"); ?> <?php include (TEMPLATEPATH . "/searchform.php"); ?> </div><!-- end center --> <div class="right"> <h3 class="tools">Recent Comments</h3> <p><?php mdv_recent_comments(8, 13, '', ' [...]<br />', true, 0); ?></p> </div><!-- end right --> Now ... this gives me a perfect view in FireFox .... http://img148.imageshack.us/img148/9121/firefoxej7.jpg But Internet Exploder messes up .... and pushes everything to the right ... http://img148.imageshack.us/img148/5365/ievs9.jpg Can you guys suggest approprate solutions for this Any help would be much appreciated.... Thanks, Abhi |