CSS - Float Difficulties In Css, Among Other Oddities
Okay, so a while ago a create a simple web page using only CSS and <div> among other assorted tags - bascially, a tableless layout. Recently, however, it has been displaying weird in IE6, and has never displayed correctly in Firefox. The content is supposed to float right, right next to the sidebar, but instead induces a return then floats right. I think this may have to do with block-level elements, but I am not sure. Also, there seems to be problems with my line-height and <h1> within .content in Firefox, but not Internet Explorer. I did submit my XHTML to W3C and it returned fine. My CSS returned no errors, but warnings, quoted below.
Quote: * Line : 2 (Level : 1) You have no color with your background-color : body * Line : 20 (Level : 1) You have no background-color with your color : a.nav:visited * Line : 20 (Level : 1) You have no background-color with your color : a.nav:visited * Line : 22 (Level : 2) Redefinition of font-weight : a.nav:link * Line : 22 (Level : 2) Redefinition of font-weight : a.nav:visited * Line : 27 (Level : 1) You have no background-color with your color : a.nav:active * Line : 40 (Level : 1) You have no background-color with your color : a.first * Line : 48 (Level : 1) You have no background-color with your color : a.first:visited * Line : 48 (Level : 1) You have no background-color with your color : a.first:visited * Line : 57 (Level : 1) You have no background-color with your color : a.first:hover * Line : 57 (Level : 1) You have no background-color with your color : a.first:hover * Line : 65 (Level : 1) You have no background-color with your color : a:hover * Line : 65 (Level : 1) You have no background-color with your color : a:hover * Line : 65 (Level : 1) You have no background-color with your color : a:hover * Line : 65 (Level : 1) You have no background-color with your color : a:hover * Line : 74 (Level : 1) You have no background-color with your color : a.last * Line : 82 (Level : 1) You have no background-color with your color : a.last:active * Line : 82 (Level : 1) You have no background-color with your color : a.last:active * Line : 82 (Level : 1) You have no background-color with your color : a.last:active * Line : 91 (Level : 1) You have no background-color with your color : a.last:hover * Line : 100 (Level : 1) Same colors for color and background-color in two contexts #firstheader and a.paralink * Line : 100 (Level : 1) Same colors for color and background-color in two contexts .content h1 and a.paralink * Line : 100 (Level : 1) You have no background-color with your color : a.paralink * Line : 100 (Level : 1) Same colors for color and background-color in two contexts #footer and a.paralink * Line : 100 (Level : 1) Same colors for color and background-color in two contexts #thirdheader and a.paralink * Line : 100 (Level : 1) Same colors for color and background-color in two contexts #navheader and a.paralink * Line : 100 (Level : 1) Same colors for color and background-color in two contexts a.nav:hover and a.paralink * Line : 109 (Level : 1) Same colors for color and background-color in two contexts .content h1 and a.paralink:visited * Line : 109 (Level : 1) Same colors for color and background-color in two contexts #firstheader and a.paralink:visited * Line : 109 (Level : 1) Same colors for color and background-color in two contexts #navheader and a.paralink:visited * Line : 109 (Level : 1) You have no background-color with your color : a.paralink:visited * Line : 109 (Level : 1) Same colors for color and background-color in two contexts #firstheader and a.paralink:visited * Line : 109 (Level : 1) You have no background-color with your color : a.paralink:visited * Line : 109 (Level : 1) Same colors for color and background-color in two contexts #thirdheader and a.paralink:visited * Line : 109 (Level : 1) Same colors for color and background-color in two contexts #thirdheader and a.paralink:visited * Line : 109 (Level : 1) Same colors for color and background-color in two contexts a.nav:hover and a.paralink:visited * Line : 109 (Level : 1) Same colors for color and background-color in two contexts #footer and a.paralink:visited * Line : 109 (Level : 1) Same colors for color and background-color in two contexts .content h1 and a.paralink:visited * Line : 109 (Level : 1) Same colors for color and background-color in two contexts a.nav:hover and a.paralink:visited * Line : 109 (Level : 1) Same colors for color and background-color in two contexts #footer and a.paralink:visited * Line : 109 (Level : 1) Same colors for color and background-color in two contexts #navheader and a.paralink:visited * Line : 118 (Level : 1) Same colors for color and background-color in two contexts #footer and a.paralink:hover * Line : 118 (Level : 1) You have no background-color with your color : a.paralink:hover * Line : 118 (Level : 1) Same colors for color and background-color in two contexts .content h1 and a.paralink:hover * Line : 118 (Level : 1) Same colors for color and background-color in two contexts #footer and a.paralink:hover * Line : 118 (Level : 1) Same colors for color and background-color in two contexts #navheader and a.paralink:hover * Line : 118 (Level : 1) Same colors for color and background-color in two contexts #navheader and a.paralink:hover * Line : 118 (Level : 1) Same colors for color and background-color in two contexts #firstheader and a.paralink:hover * Line : 118 (Level : 1) Same colors for color and background-color in two contexts #thirdheader and a.paralink:hover * Line : 118 (Level : 1) Same colors for color and background-color in two contexts #thirdheader and a.paralink:hover * Line : 118 (Level : 1) You have no background-color with your color : a.paralink:hover * Line : 118 (Level : 1) Same colors for color and background-color in two contexts a.nav:hover and a.paralink:hover * Line : 118 (Level : 1) Same colors for color and background-color in two contexts a.nav:hover and a.paralink:hover * Line : 118 (Level : 1) Same colors for color and background-color in two contexts .content h1 and a.paralink:hover * Line : 118 (Level : 1) Same colors for color and background-color in two contexts #firstheader and a.paralink:hover * Line : 157 (Level : 1) You have no background-color with your color : #auc * Line : 157 (Level : 1) You have no background-color with your color : #auc * Line : 165 (Level : 1) You have no background-color with your color : #quote * Line : 200 (Level : 1) You have no color with your background-color : .sidebar * Line : 212 (Level : 1) You have no color with your background-color : .darkersidebar * Line : 223 (Level : 1) You have no color with your background-color : #lastsidebar * Line : 236 (Level : 1) You have no background-color with your color : .sidebar div * Line : 236 (Level : 1) Same colors for color and background-color in two contexts #secondheader and .sidebar div * Line : 236 (Level : 1) Same colors for color and background-color in two contexts .darkersidebar and .sidebar div * Line : 236 (Level : 1) Same colors for color and background-color in two contexts #lastsidebar and .sidebar div * Line : 268 (Level : 1) You have no color with your background-color : .content * Line : 283 (Level : 1) You have no background-color with your color : .content p * Line : 321 (Level : 1) You have no background-color with your color : ul Now, I have images to show my problems since the site is no longer up; however, it has irked me lately that I haven't figured out a solution to this problem. Forgive me if I made a stupid mistake, as I haven't touched CSS in a few months and am still "refreshing" my memory on it - but even so, I couldn't pinpoint this problem while I still had my finger on CSS pretty well. These imaged will be linked, since they are enormous. IE6 Firefox-Part 1 Firefox-Part 2 And now, finally, my stylesheet and XHTML document. XHTML document CSS file Forgive me, again, if it's a REALLY stupid mistake, but I can't figure out the problem and seeing as I'm the one assigned to make a web site for a school project, I'd like to know what I did wrong so I won't make the same mistake again. I managed to figure out what was wrong with the script in the XHTML document (not corrected in this version, though) so this would be getting a real big monkey off my back. As you can see, there are alignment issues in addition to the detestable return problem. And yes, I did try making .content "display:inline;" same with one of the sidebar classes, to no avail... EDIT: I just realized that the IE pic is cut off - the only problem with this version is that the side content seen in Firefox 2 is not floated to the right of the .sidebar correctly. So it's the same as Firefox 2 basically. Similar TutorialsHey guys, I was wondering if you could enlighten me on the right way to do this. URL On this CSS blog I'm designing for a friend, I'm trying to get the leafy sidebar to span the height of the content. My CSS for the property is: #sidebar { float: left; background: #589f45 url(images/sidebar.gif) repeat-y; height: 100%; width: 44px; } I have a feeling that the height: 100% property is causing the problem. When you look at the site, the sidebar repeats exactly one page-length and stops. The HTML markup for the page: <div id="sidebar"></div> <div id="header"></div> <div id="topbar"></div> <div id="blog"> Test<br />... </div> <div id="footer"></div> All of the other IDs are floated left. Do you guys have any suggestions? Any help would be greatly appreciated. Thanks for looking! subject isn't too good anyhow.. i have 4 cells __ __ |1 | |2 | --- --- __ __ |3| |4 | --- --- 2 and 4 are said to float right, such that 1 and 3 define the height of the page.. but.. when the contents of 2 go LONGER than the contents of 1, number 4 doesn't float right properly.. instead this happens __ __ |1 | |2 | --- | | --- | | |4| --- --- __ |3| --- do you see that? 4 tries to float right, but since it's called underneath 1, and 2 is extended, floating right relative to the page doesn't make it ACTUALLY float right any thoughts that will render this properly? (namely that cells 1 and 3 will inherit the height of 2 and 4 somehow?) Hi There - Am converting another design from tables, working with a CMS (Drupal) and an existing CSS / table combination that I didn't write and have no choice about. Think of the header as having three sections. The top section has logo on the left, search box on the right. Rounded corners. I'm cool with that section. Then there's a space. Created a div for the space. Love the space. Problems with the space in IE. Will go into it later. Then there's the next section. Rounded corners. Contains the entire page. On the left is a pulldown menu, about 1 cm from the top. On the right is a tabbed menu. This menu has flexible height. It needs to be right up against the bottom with the menu below it. Call this section the tabbed menu section. Third section. Immediately below that is a bar menu like the one Apple's got. Looks like a metal bar with divisions. Call this primary links. ---------- First, the space between. In IE, when you roll over the bar menu, the space disappears. Won't come back. Initially, in the second section, floated the pulldown menu left and the tabbed menu right. That worked fine, except that the tabbed menu had a width of 100% and pushed up the pulldown menu so the section was too wide. When I put it to 65%, all hell broke loose with the bar menu in the third section below it and bits of it snuck up into the second section. If I left it alone, and left the tabbed menu at 100%, when I checked over its container with firebug, it said that it was being affected by the primary links. I figured that out also because the background for that container was a really weird color that I finally found in the background of the navigation id and changed to white. Primary was overlapping it so I couldn't see it with firebug. So after fiddling with several clearing methods, I gave up and decided to try a table. Table worked fine, and the second section looks good except that there's a one pixel space between the tabbed menu and the bar menu. --------- It is my greatest wish right now to be able to float the pulldown to the left, the tabbed menu to the right and have the primary links stay below. I wish I could get the space to work and I wish for a clear understanding of it all so I can then figure out where to put the corners. Anyone who can enlighten me on this would have my undying gratitude. I've been working on this all day and the deadline's tomorrow. Code: <div id="top part" logo and searchbox </div> <div> that pesky space that disappears in IE when roll over primary links </div> <div id=navcontainer> dropdown and tabbed menu </div> <div id="navigation" class="menu> <!-- couldn't find the menu class in the css --> <div id="primary" class="clear-block"> contains barmenu - very fussy </div> </div> Here's the relevant CSS: Code: div#navigation { background: #fff url(../images/blue/menu-bg.png) 100% 100% repeat-x; } #primary { line-height: 30px; } #primary ul { padding:0; margin:0; list-style:none; } #primary li { display:inline; } #primary a { font-weight:bold; display:block; float:left; padding:0px 14px 0px 14px; margin: 0px 1px 0px 0px; font-size: 95%; } #primary a { background-position:0% 0px; } #primary a:hover { text-decoration: none; background-position:0% -42px; } #primary a.active { background-position: 0% -84px; } #primary a { background: url(../images/blue/menu-div.png) 100% 0 repeat-y; color:#666666; font-size: 120%; font-family:Arial,Helvetica,sans-serif; } #primary a:hover { color: 666666; background: #B8B8B8; } #primary a.active { color: 666666; background: #B8B8B8; } This is my first try at css and i have been at it about a week on and off. I have tried to use examples from here and the o'reilly CSS cookbook. I want to create a two column row of pictures with a caption. I selected DIV as the tool (my css is below). The container DIV looks great. I want the div.float, however, to start a second row when a third picture is added and to continue thereafter with successive two column rows. Unfortunately, each of my rows contain only one picture. here is my css style sheet. A demonstration of the problem can be seen at: http://www.yourline-online.com/demo05/?How_to_create_pages Code: div.float { float: left; BORDER-RIGHT: #808080 2px solid; PADDING-RIGHT: 2px; BORDER-TOP: #808080 2px solid; PADDING-LEFT: 2px; FONT-WEIGHT: lighter; FONT-SIZE: medium; PADDING-BOTTOM: 20px; MARGIN: 16px 2%; BORDER-LEFT: #808080 2px solid; COLOR: #000000; PADDING-TOP: 2px; BORDER-BOTTOM: #808080 2px solid; HEIGHT: 200px; WIDTH: 150px; BACKGROUND-COLOR: #ffffff; TEXT-DECORATION: none } div.float p { text-align: center; } div.container { border: 2px dashed #333; background-color: #ffe; } div.spacer { clear: both; } MY HTML is like this: Code: H1>How to create pages</H1> <P>The headings are used for splitting up the content file. An H1, H2 or H3 heading will dynamically split the document into new pages in the table of contents. An H4-heading is used as a heading within a page. See the following pages...<BR></P> <P></P> <DIV class=container> <DIV class=spacer></DIV> <DIV class=float><IMG height=100 alt="image 1" src="image1.gif" width=100> <P>caption 1</P></DIV> <DIV class=spacer></DIV> <DIV class=float><IMG height=100 alt="image 2" src="image2.gif" width=100> <P>caption 2</P></DIV> <DIV class=spacer> <DIV class=float><IMG height=100 alt="image 3" src="http://www.yourline-online.com/demo05/image3.gif" width=100> <P>caption 3</P></DIV> <DIV class=spacer></DIV></DIV></DIV> Hi all, I have a bit of an odd situation (prob not odd if you seen it before but I have no clue why its doing it!).... I have my webpage: http://www.houseofhawkins.com/index.html which works great in IE. the part in question is the menu tabs at the top. Within IE they keep the width I have given them.. In firefox they only go to the width of the text. They are links with the following CSS attached: div#Header #MenuSection a.MenuTab { PHP Code: filter:progid:DXImageTransform.Microsoft.Gradient(endColorstr='#A8DBA8', startColorstr='#A4B7A4', gradientType='0'); font-weight: bold; text-align: center; font-size: 1.3em; background-color: #BCD6BC; border-style: solid; border-width: 1px; border-color: #A5BEA5 #BCD6BC #BCD6BC #A5BEA5; margin: 0 5px 0 2px; height: 1.5em; width: 140px; padding: 5px 1px 1px 1px; } div#Header #MenuSection { float:left; margin-top: 30px; } here is the HTML code for that part of the page. PHP Code: <div ID="MenuSection"> <a Class="SelectedMenuTab" Title="You are currently viewing the Home page">Home</a> <a Class="MenuTab" href="" title="Curriculum Vitae for Jonathan Hawkins, Author of House of Hawkins">CV</a> <a Class="MenuTab" href="http://houseofhawkins.com/projects/index.html" title="Portfolio of Work created by Jon Hawkins">Portfolio</a> <a Class="MenuTab" href="" title="Online Photo Gallery of Jon, friends and family">Photo Gallery</a> <a Class="MenuTab" href="http://houseofhawkins.com/games.html" title="Games created by House of Hawkins">Games</a> </div> <div style="clear:left"> </div> I just dont get why firefox wont be nice and give me the width I ask for... the oddest bit is if I put float:left into the menutab part they do work! I wish to understand why its like this... I have attached the CSS and the file if that helps anyone. Thanks for the help and advice. Hello everyone, I've been working on my school website for some time now - but I recently started over where the markup and style sheets are concerned. Both my html and css validate. This is my html source: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Secondary School</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="style.css" rel="stylesheet" type="text/css"> <script type="text/javascript"> <!-- function view_event(url) { window.open(url, 'event', 'top=100, left=100, width=200, height=350'); return false; } //--> </script> </head> <body> <div id="container"> <h1> Secondary.School. </h1> <div id="nav"> <ul> <li> <a href="index.php"> Homepage </a> </li> <li> <a href="#"> School Information </a> </li> <li> <a href="departments.html"> Departments </a> </li> <li> <a href="#"> Clubs </a> </li> <li> <a href="#"> SCC </a> </li> <li> <a href="#"> Resources </a> </li> </ul> </div> <div id="primaryRail" class="rail"> <h2> Contact information </h2> <p> <b> 127 Maple Street Testo, Orbuk, H58 435 </b> <br /> <b> Telephone: </b> (456) 245-5677 <br /> <b> Fax: </b> (456) 456-4567 </p> </div> <div id="secondaryRail" class="rail"> <h2> Our administration </h2> <p> <b> Principal: </b> <i> Alan N </i> <br /> <b> Vice-Principal: </b> <i> Lucy S </i> <br /> <b> Vice-Principal: </b> <i> Candice H </i> </p> </div> <div id="primaryContent" class="content"> <h3> Welcome to the Secondary School website! </h3> <p><b>XHTML TESTING</b><br /> April 11, 2007<br /> Posted by : <b>admin</b><br /> Pellentesque sit amet mauris. Nullam non lacus. Etiam auctor. In purus. Nulla dolor lectus, posuere et, cursus a, tincidunt non, mi. Vestibulum interdum turpis in erat vehicula consequat. Vivamus sit amet turpis vitae massa tristique auctor. Mauris quis turpis. Quisque at mi. Suspendisse consequat faucibus elit. Morbi scelerisque porttitor ligula. Vestibulum non purus. <a href="#"> link testing </a><br /> <a href="#top">Top</a></p><p><b>admin</b><br /> April 11, 2007<br /> Posted by : <b>admin</b><br /> Pellentesque sit amet mauris. Nullam non lacus. Etiam auctor. In purus. Nulla dolor lectus, posuere et, cursus a, tincidunt non, mi. Vestibulum interdum turpis in erat vehicula consequat. Vivamus sit amet turpis vitae massa tristique auctor. Mauris quis turpis. Quisque at mi. Suspendisse consequat faucibus elit. Morbi scelerisque porttitor ligula. Vestibulum non purus. <br /> <a href="#top">Top</a></p><p><b>test</b><br /> April 10, 2007<br /> Posted by : <b>mr.southern</b><br /> test<br /> <a href="#top">Top</a></p><p><b>test</b><br /> April 10, 2007<br /> Posted by : <b>mr.s</b><br /> test<br /> <a href="#top">Top</a></p><p><b>Testing</b><br /> April 09, 2007<br /> Posted by : <b>Jonathan</b><br /> This is just a test message.<br /> <a href="#top">Top</a></p><p><b>test</b><br /> April 05, 2007<br /> Posted by : <b>test</b><br /> test<br /> <a href="#top">Top</a></p><p><b>Test</b><br /> April 05, 2007<br /> Posted by : <b>Jonathan</b><br /> Test.<br /> <a href="#top">Top</a></p><p><b>Another test post.</b><br /> April 05, 2007<br /> Posted by : <b>Jonathan</b><br /> Just another test.<br /> <a href="#top">Top</a></p><p><b>Lorem ipsum dolar et sit</b><br /> April 05, 2007<br /> Posted by : <b>Jonathan</b><br /> This is just a test post.<br /> <a href="#top">Top</a></p><p><b>Lorem ipsum dolar et sit</b><br /> April 05, 2007<br /> Posted by : <b>Jonathan</b><br /> This is just a test post.<br /> <a href="#top">Top</a></p> </div> <div id="secondaryContent" class="content"> <h2>Calendar for April 2007</h2> <table> <tr class="days"><td>Su</td> <td>Mo</td> <td>Tu</td> <td>We</td> <td>Th</td> <td>Fr</td> <td>Sa</td> </tr> <tr><td class="week" title="Sun, 01st April 2007">1</td> <td class="week" title="Mon, 02nd April 2007">2</td> <td class="week" title="Tue, 03rd April 2007">3</td> <td class="week" title="Wed, 04th April 2007">4</td> <td class="week" title="Thu, 05th April 2007">5</td> <td class="week" title="Fri, 06th April 2007">6</td> <td class="week" title="Sat, 07th April 2007">7</td> </tr><tr> <td class="week" title="Sun, 08th April 2007">8</td> <td class="week" title="Mon, 09th April 2007">9</td> <td class="week" title="Tue, 10th April 2007">10</td> <td class="week" title="Wed, 11th April 2007">11</td> <td class="week" title="Thu, 12th April 2007">12</td> <td class="week" title="Fri, 13th April 2007">13</td> <td class="week" title="Sat, 14th April 2007">14</td> </tr><tr> <td class="week" title="Sun, 15th April 2007">15</td> <td class="week" title="Mon, 16th April 2007"><a href="calendar.php?dateline=1176699600" style="padding: 0px;" onclick="return view_event(this.href);"><span style="color: red; font-weight: bold;">16</span></a></td> <td class="week" title="Tue, 17th April 2007">17</td> <td class="week" title="Wed, 18th April 2007">18</td> <td class="week" title="Thu, 19th April 2007">19</td> <td class="week" title="Fri, 20th April 2007">20</td> <td class="week" title="Sat, 21st April 2007">21</td> </tr><tr> <td class="week" title="Sun, 22nd April 2007">22</td> <td class="week" title="Mon, 23rd April 2007">23</td> <td class="week" title="Tue, 24th April 2007">24</td> <td class="week" title="Wed, 25th April 2007">25</td> <td class="week" title="Thu, 26th April 2007">26</td> <td class="week" title="Fri, 27th April 2007">27</td> <td class="week" title="Sat, 28th April 2007">28</td> </tr><tr> <td class="week" title="Sun, 29th April 2007">29</td> <td class="week" title="Mon, 30th April 2007">30</td> <td class="week"> </td> <td class="week"> </td> <td class="week"> </td> <td class="week"> </td> <td class="week"> </td> </tr> </table> <a href="index.php?m=3">Previous month</a> <a href="index.php?m=5">Next month</a> <p style="font-weight: bold;">XHTML TESTING</p> <p style="font-weight: bold;">admin</p> <p style="font-weight: bold;">test</p> <p style="font-weight: bold;">test</p> <p style="font-weight: bold;">Testing</p> <p style="font-weight: bold;">test</p> <p style="font-weight: bold;">Test</p> <p style="font-weight: bold;">Another test post.</p> <p style="font-weight: bold;">Lorem ipsum dolar et sit</p> <p style="font-weight: bold;">Lorem ipsum dolar et sit</p> <p>Pellentesque sit amet mauris. Nullam non lacus. Etiam auctor. In purus. Nulla dolor lectus, posuere et, cursus a, tincidunt non, mi. Vestibulum interdum turpis in erat vehicula consequat. Vivamus sit amet turpis vitae massa tristique auctor. Mauris quis turpis. Quisque at mi. Suspendisse consequat faucibus elit. Morbi scelerisque porttitor ligula. Vestibulum non purus. </p> </div> </div> <div id="footer"> <p> <img src="images/tiger.jpg" alt="tiger logo" style="float: left;" /> | <a href="#"> homepage </a> | <a href="#"> school information </a> | <a href="#"> departments </a> | <a href="#"> clubs </a> | <a href="#"> scc </a> | <a href="#"> resources </a> | <br /> Copyright <span style="font-size: x-small;"> 2007 </span> Secondary School. </p> </div> </body> </html> And this is my style sheet: Code: /* Secondary School CSS Document /* Page and Link Formatting ---------------------------- */ a { text-decoration: underline; font-family: Georgia; padding-bottom: 3px; color: #FF42B1; } #nav a { text-decoration: none; font-family: Georgia; font-size: 12px; padding: 12px 10px 8px 10px; color: #F9F9F9; } #nav a:hover { background: #454545; } #nav li { display: inline; } body { background: url('images/header.png') repeat-x; margin: 0px; padding: 0px; text-align:center; } /* Divs etc... ---------------------------- */ #container { margin:0px auto; width: 700px; text-align: left; } #container h1 { margin-top: 60px; } #primaryRail { width: 350px; float: left; } #secondaryRail { width: 350px; float: left; } #primaryContent { margin: 55px 0px 0px 0px; width: 500px; float: left; } #secondaryContent { margin: 55px 0px 0px 25px; width: 175px; float: left; } #footer { clear: both; text-align: center; background: #EDEDED; border: #E2E2E2 2px solid; } /* Standard Elements ---------------------------- */ h1 { font-family: Georgia; font-weight: normal; font-size: 2em; color: #F9F9F9; } h2 { font-family: Georgia; font-weight: normal; font-size: 1.5em; color: #454545; } h3 { font-family: Georgia; font-weight: normal; font-size: 1.5em; color: #812F2F; } .rail h2 { color: #FFD11B; } p { font-family: Georgia; font-size: .85em; color: #454545; } .rail p { color: #F9F9F9; } .content p { line-height: 1.5em; } ul { padding: 0px; } li { list-style: none; } table { color: #AFAFAF; } td { padding: 5px; padding-top: 2px; padding-bottom: 2px; } .days { background: #DCDCDC; font-weight: bold; font-size: .75em; } .week { background: #FFFFFF; font-size: .75em; } .nomonth { background: #FAFAFA; } #swd_info { display: none; font-family: Verdana, Arial, Helvetica, sans-serif; position: absolute; width: 180px; background-color: #FFFF99; color: #000000; border: 1px solid #000000; padding: 3px; font-size: 10px; text-align: justify; } This is how it looks in FF, and that is how I would like to to be in FF, and any common browser that the user may be operating: img133.imageshack.us/my.php?image=ffexampletx6.jpg Thank you! Hi, this bug is driving me nuts. I don't know why it happens. All I know is that it is not even consistent. Here's a screenshot of the problem: http://www.argsoccertours.com/float-problem.jpg And here's the code for that part: Code: <p>The bus will take you to your hotel, where you can leave your luggage and take a shower.</p> <p>This day we suggest the Buenos Aires City Tour. Discover one of the most amazing cities in the world. Buenos Aires is a thoroughly modern city with more than 400 years of history. Visit Florida street, one of the most surprising pedestrian streets in South America. You don't want to miss Palermo Soho, the trendiest neighborhood in Argentina, where you will find tourists from all over the Globe;<img src="images/caption10.jpg" alt="Caminito" width="300" height="300" class="floatright" /> visit Puerto Madero, the preferred area for luxury offices and restaurants; and also check out San Isidro, the most exclusive neighborhood in Buenos Aires.</p> <p>You will also get to see Argentina's historic buildings, the <em>Casa Rosada</em> (which means "Pink House" and is the President's office), the <em>Obelisco</em> (a huge tower with a lot of history), and some of the oldest, yet best mantained museums and theaters in the world.</p> <p>Finish the day with a short visit to Recoleta, the neighborhood of choice for expats in Buenos Aires to have a good time and eat at the best restaurants.</p> <h2>Thursday, March 4 - <span class="redsubtitle">Practice + Palermo Soho + Recoleta</span></h2> <p>Your team will have a practice in the morning. A complimentary transfer will be available for you and your Tour Manager will help you with any arrangements that you need.<img src="images/caption11.jpg" alt="Rugby practice" class="floatright" /></p> <p>In the afternoon you can have <em>Tapas</em> -a Spanish typical dish- in Palermo Soho, a place that is so cool you will never forget it.</p> The CSS for floatright is: Code: .floatright { float: right; margin-top: 10px; margin-bottom: 10px; margin-left: 10px; } As you can see in the code, in both cases I insert the image the same way, but the first one looks OK and the second one doesn't. This happens on IE7 (not sure about other versions of IE), but for sure it doesn't happen on FF. Anybody has any clue on what could cause this? I almost feel guilty about posting this question, as it has probably been answered in some form before and i just need to figure it out myself, but this is giving me some difficulty. My page displays just how I want it right now to display in Firefox. However, in IE6, it does not display correctly. The XHTML and CSS are both validated and it works perfectly in the more "standard-compliant" browser. But I'm sure there is a way to get this to work in IE as well. the site is fusiondesign.awardspace.com (new user policy will not let me use links ) the relevant XHTML: Code: <div id="container"> <div id="nav"> <a href="#" onclick="changeTab('Home','hcontent');" id="Home">Home</a> <a href="#" onclick="changeTab('About','acontent');" id="About">About</a> <a href="#" onclick="changeTab('Services','scontent');" id="Services">Services</a> <a href="#" onclick="changeTab('Order','ocontent');" id="Order">Order</a> <a href="#" onclick="changeTab('Contact','ccontent');" id="Contact">Contact</a> <a href="#" onclick="changeTab('Links','lcontent');" id="Links">Links</a> </div> <div id="content"> <noscript> I noticed you have Javascript disabled. This site will not work correctly unless you have Javascript enabled. Please enable Javascript now. </noscript> </div> ... </div> and the relevant CSS: Code: div#container { position:absolute; left:50%; top:50%; width:760px; height:332px; margin-left:-380px; margin-top:-186px; border:#FFFFFF 1px solid; } div#nav { float:left; width:170px; padding:0; } div#content { text-align:justify; width:558px; padding:1em; color:#000000; height:300px; overflow:auto; /*border:#FFFFFF 1px solid;*/ } Any direct help or a link to a solution would be greatly appreciated I always have trouble with floats. I'm just trying to get these two bulleted lists to display next to each other so that the page is shorter. It isn't exactly working. Close but not quite. Changing the left margin hasn't helped (even bumped it to 55, but it had no effect.) <span style="float:left;"><h4>New Listings</h4> <p>Be prepared with:</p> <ul> <li>Sales Price</li> <li>Property particulars</li> <li>Company</li> <li>Address</li> <li>Your name</li> <li>Phone number</li> </ul></span> <span style="margin-left: 15em;"><h4>Price and Property Changes</h4> <p>Please state:</p> <ul> <li>Price change or any changes</li> <li>Address</li> <li>Company</li> <li>Name</li> <li>Phone number</li> </ul></span> <span style="float:clear;"><h4>Buyer Wants</h4><span> <p>Describe your buyer's wants and needs. You will have 30 seconds to present your buyer wants.</p> Basically, following link: www.projectfinalfantasy.com Works fine in FF but IE, it piles the divs under eachother, whether the float tag is applied or not. Any help would be greatly appreciated. Cheers, Joe. I am trying to put a float to the right side of a layer and then have it go over the right side of the layer. But when I do this the part that is moved over is not visible in IE. I have included an example to make it easier to explain. The green layer should be partially outside the blue layer by 100px. I would appreciate any help getting this done. Thanks Code: <style type="text/css"> .main { position: relative; top: 100px; width: 700px; background-color: #5577cc; height: 500px; } .floatright{ margin-right: -100px; float: right; width: 300px; height: 300px; background-color:#339900; } </style> </head> <body> <div class = "main"> Main <div class = "floatright"> Float </div> </div> </body> My home page at mypricesavings.com I would like to have the twitter banner under the headline to be in its own div. if you look at my style.css I have this code Code: #twitter { width:590px; float:left; background:#fff; padding:10px; font-size:1.05em; line-height:1.5em; margin: 10px 0; } Which in fact does what I need it to do when I then add the div to the index.php however, the store deals and matchups which is the featured div no longer floats to the right of the headline, it will drop all the way down and float next to the twitter. I do not understand how CSS exactly works and would like to know how to make the twitter be the way I would like it and have the featured work corectly too. thank you in advance for helping Derrick can anyone tell me where I am going wrong? I am trying to float just a side column and a main together, but no matter what I try I cannot get the main to go up next to the sidebar. It works if I put the sidebar to the left, but not the right. I cleared 'both' after the main window, supposedly to make them float together in a container, but nothing I do works. test site at mycomputerpro dot com dot au thanks Wayne Hey all, I'm wanting to create something like this: HEADER TITLE ___________________ TEXT HERE + - _______________________________ TEX HERE + - _______________________________ TEX HERE + - Ignore the underscores. Now I'm trying this code: Code: <div> <h2 style="display:inline;">HEADER TITLE</h2> <div style="float:right; padding:0; margin:0;"> TEXT HERE + - <br /> etc.. </div> </div> But no matter what I try the 'TEXT HERE' does not appear on the same inline and the floated div appears one line down like so: HEADER TITLE _______________________________ TEXT HERE + - _______________________________ TEXT HERE + - _______________________________ TEXT HERE + - Any suggestions on how to correct this? Thanks Thanks for taking the time to read my question. If I use float: none; in my css the result in IE is perfect. However in Firefox it doesn't work. Is there a workaround for this? see "Past Pierced Shows" bottom left corner of page in IE the images and text line up, in Firefox, they are one under another. www.pierced.ca/pierced-events.htm Thanks for the help, Brad arg arg arg and you all know the rest. anyway to the problem in firefox the layout is all good but in IE things are realy starting to annoy me. http://217.68.23.6/~themodem.co.uk/index.php i think its my float stuff but im not sure, could someone please take a look at it for me heres my css Code: body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color:#000000; } #leftcontent { float:left; width: 236px; } #mainmenu { width: 170px; } #stats { margin-top:inherit; width: 205px; background-color:#000000; } #centercontent { voice-family: "\"}\""; voice-family: inherit; margin-left: 245px; background-image:url(images/wow/bg.gif); background-repeat:repeat; } #rightcontent { float:right; margin-right:5px; width: 236px; margin-top:20px; } #login { margin-top:inherit; width: 205px; background-color:#000000; } #submenu { width: 200px; } #banner { voice-family: "\"}\""; voice-family: inherit; } thanks Lee Hi all, I am in a rush, and stumped, check out this page (in Internet Explorer 7): http://72.167.22.172/new/programs.php?t=8 See the footer? Any insight? (works fine in firefox etc.) i've tried variations of inline/block display, and anything else i could think of...i want an orange border around the L and R divs, but all i get is a 2px border with no content, and the L and R floated on top of the border...plz shed some light on what i'm doing wrong Code: <style type="text/css"> div { background: #E7E7E7; border:1px solid #CCCCCC; } div#l { float:left; } div#r { float:right; } </style> </head> <body> <div style="margin:auto;width:1000px;text-align:center;border:2px solid ORANGE"> <div id="l"> L </div> <div id="r"> R </div> </div> </body> Ive tried to make the text float next to the image but when i try the text just sits below the div line under the image to the right. here is the URL: http://www.nevertap.com/s_media.php here is the markup: Code: <div id="center_top_content_header"> <h3>Event DVDs</h3> <div id="center_top_content"> <a href="http://www.nevertap.com/s_media_01.php"><img src="/i/cover_thmb.jpg" alt="Nevertap: Season 1" /></a> <div id="imagetext"> <p><span class="plusone bold">Nevertap Season 1 DVD, 5 hours of premium submission grappling! 19.99 Plus S&H</span></p> </div> <!-- END imagetext --> </div> <!-- END center_top_content --> </div> <!-- END center_top_content_header --> And here is the relavent CSS: Code: div#center_window { /* margin-top: 0px;*/ margin-left: 215px; margin-right: 250px; padding: 5px; height: 100%; /* border-left: 1px solid black; */ /* border-right: 1px solid black; */ /*border: 1px solid black; */ } div#center_top_content_header { width: auto; margin: auto; border: 1px solid black; } div#center_top_content { padding: 0 10px 10px 10px; width: auto; margin: auto; /*border: 1px solid black; */ } div#imagetext { float: right; width: auto; margin: auto; padding: 0; display: inline; border: 1px solid black; } I would be VERY appreciative if someone could tell me why the big quote mark in the bottom left text box of this page does not look correct in IE7...it looks great in Firefox...the big quote mark should be raised above the text as it is in FF.... I'm floating 2 <p> elements there, and put borders around the <p> elements to see what was happening...I even put the <p> elements inside a container <div>, but that didn;t help....I reluctantly used a negative margin in FF, but the same doesn;t work in IE....Am I missing something simple here? Thanks for any help... |