CSS - Multicolumn Float Not Working
hey guys i have an issue with a multicolumn float issue on my page
here is the css Code: vi portal.css #contentcontainer { position: absolute; background-color: blue; top: 20px; left: 100px; right: 100px; width: 500px; } #protal .portal-column { float: left; width: 30%; } #portal #portal-column-block-list { position: absolute; width: 200px; top: 180px: left: 10px; z-index: 10; } #portal .block .block-toggle { background-image: url(block-slide.png); float: right; cursor: pointer; } #portal .block .block-toggle span { display: none; } #portal .block-list-handle, #portal .handle { cursor: move; } and the HTML in question Code: <div id="contentcontainer"> <div id="protal"> <div class="partal-column" id="portal-column-0"> <h2>Column 0</h2> </div> <div class="portal-column" id="portal-column-1"> <h2>Column 1</h2> </div> <div class="portal-column" id="portal-column-2"> <h2>Column 2</h2> </div> <div class="portal-column" id="portal-column-block-list" style="display: none;"> <h2 class="block-list-handle">Block List</h2> <!-- Blocks go here --> <div class="block"> <h3 class="handle"> <a class="block-toggle"<span>toggle</span></a> <!-- title of block --> testing links </h3> <div class="content"> <!-- Content --> <?php $content = array(1 => 'Home', 2 => 'About', 3 =>'Contact'); echo ("<ul> \n"); foreach ($content as $id => $page) { echo ("<li><a href='?id=$id'>$page</a></li> \n"); } echo ("<ul> \n"); ?> </div> </div> </div> </div> </div> the problem is that it appears that only column-2 and column-1 maybe are floating to the left properly. anyone got some suggestions on whats wrong Similar TutorialsHi 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; } To make this easier on everyone, I've turned my idea into an image, so please see the image I attached. I'm absolutely horrible with CSS, so I just need some help with converting that image into CSS/HTML. I'm hoping to have each box an unordered list, so they are still organized nicely even if someone has CSS disabled. Thanks. The css is as #content { position: absolute; top: 180px; margin-left: 20%; font-family: verdana; font-size: 12pt; color: blue; } div#column1 { background: #CCCCFF; margin-left: 40px; width: 500px; height: 300px; font-family: verdana; font-size: 12pt; } div#white { background: white; } The html code <div id="content"> <div id="column1">col1<br>line1   line1<br><br><br>line3 <div id="white"> </div> col2<br>line1<br>line2<br> <div id="white"> </div> col3<br>line1<br>line2 </div> </div> The code above displays 3 columns one below other. actually a single column is there with space which seems to be 3 columns one below the other. i want a column to be displayed on the right. Have a look at the attached layout. can the code above be altered to get a effect like that . Or should i write code for 5 columns(divs). Please suggest me ! I have looked at this a million times and now I've completely lost track... This is the layout in IE: as you can see, it looks perfectly fine, just like I wanted it to look...but then... this is how it looks like in Mozilla: The lay-out is all messed up..it seems like there is a fault in the code with the top left floater..because the right floater only begins at the same point the top left floater ends... I truly want this to look fine in both browsers...even though the most people use IE... (the page is at http://www.finedesigns.nl/portfolio/voorbeeld huisarts) this is the coding: body { background-color:#FFFFFF; text-align: center; } a { font-size:10px; text-decoration:none; font-weight:600; font-family:verdana; } a:link {color:#006666;} a:visited {color:#006666;} a:hover {color:#CC9900;} #container { background-color:#006666; margin-left: auto; margin-right: auto; text-align: left; width: 100%; margin: 10px auto; font-family:verdana; font-size:10px; color: #006666; line-height: 120%; } #Header { padding: 5px; height:100px; } #Left { float: left; width: 150px; margin-right:5px; margin-left:5px; background-color:#CCFFCC; } #Left2 { clear:left; float: left; width: 150px; height:210px; margin-right:5px; margin-left:5px; background-color:#CC9900; } #Right { float: right; width: 150px; height:450px; margin-right:5px; margin-left:5px; background-color:#CCFFCC; } #Content { background-color:#FFFFFF; height:450px; margin-left: 160px; margin-right: 160px; padding: 10px 10px 10px 10px; } #Footer { clear:both; background-color:#006666; padding: 0px; height:5px; } Hi, I'm puzzling with an annoying thing quite some time now so I decided to ask for some help. On a website called 'Unlock LG online' (can't post links :S, if you use that exact search term the first result in google) when you select a model and thus go to, for example: 'Unlock LG online U990' 2nd search result in google (again can't place links) you can see the photo of the phone to the right and some text at the left. Now in FF and IE8 no problem at all. But in IE6 and 7 it is not floating but the text just goes under the 'not floating' image. Now I though the double margin bug so I added 'display: inline' (also tried position: inline) but that doesn't work either. I've been playing with the margins and padding but no luck either.. in other words I have no clue any more.. Please give me some tips. Thanks! Best regards, I'm relatively new to CSS and I am struggling with my style sheet for IE. I've put my images in div's and applied a float to them. It looks great in FF and Chrome, but not so much in IE. Being a new user to the forum, my url has been blocked. The site is swampasspowder dot com. Any help or comments are appreciated. http://whittierpunks.com/test/bio.html and stylesheet In the CENTER <div>, I want to have some text, with an image floated to the right. It's basic; there is no problem with an internal stylesheet (like the example at w3c)...but as you can see from my exapmle, its not doing that at all. And I'm not sure where the problem lies Could someone show me how to correct this? Many thanks, Maybe I'm just missing something here, but I can't get the right column of the search box to align at the top. At first I thought it had something to do with the specified widths, but that did not work. I'm sure this is a quick fix, I can't seem to figure it out though. Thanks. The site Code: <div id="searchbox"> <h2 id="searchbox_header">Browse Bus Rates and Amenities</h2> <p style="padding-left: 5px; ">Search by Bus Type:<br /> <select name="bustype"> <option selected value="">All Bus Types</option> <option value="1" >Deluxe Motor Coach</option> <option value="7" >Double Decker</option> <option value="4" >Entertainer</option> <option value="5" >Executive</option> <option value="9" >Limo Bus</option> <option value="2" >Minibus</option> <option value="3" >School Bus</option> <option value="0" >Tour Operator</option> <option value="6" >Trolley</option> <option value="8" >Van</option> </select></p> <p style="padding-left: 5px; ">Departure State / Province:<br /> <select name="state" onChange="buildCity('','');"><option selected value=""> - No state selected - </option> </select></p> <p style="padding-left: 5px; ">Departure City / Metro Area:<br /> <select name="city"> <option value="">Entire State</option> </select></p> <div id="searchboxrightcol"> <p>Or search by Zipcode:<br /><input type="text" name="zip" size="15"></p> <p>Browse local rates & inventory. Locate specific bus types</p> <p><a href="#">Search</a></p> </div> <div id="searchbox_footer"> <p>BusRates.com does its best to screen out brokers but cannot guarantee this.</p> </div> </div> CSS: #searchbox { width: 400px; margin: 0; padding: 0; border: 1px solid #003366; background: #CCCCFF; } #searchboxrightcol { padding: 0; margin: 0; margin-left: 170px; padding-left: 5px; } #searchboxleftcol { width: 160px; float: left; padding: 0; vertical-align: top; border-right: 1px solid black; } #searchbox p { padding-left: 5px; padding-right: 5px; width: auto; height: auto; } #searchbox_header { text-align: center; color: white; background: #003366; padding: 0px; margin: 0px; width: auto; } #searchbox_footer { width: 400px; text-align: center; color: black; padding: 0px; margin: 0px; } #searchbox a, #searchbox a:visited { background: #336699; text-align: center; padding: 5px 50px 5px 50px; border: 2px solid #003366; color: white; font-weight: bold; text-decoration: none; } #searchbox a:hover { background: #FC7400; text-align: center; padding: 5px 50px 5px 50px; border: 2px solid #003366; text-decoration: none; font-weight: bold; } When i float my div to the left, i cant seem to get the text to align right, can someone show me a way out of this horriable predicament i have found my self in!! HTML: Code: <div id="title" class="title_lower_color"> <div class="title">TITLE</div> </div> <div id="main"> <div class="grouptitle1">Group 1 <div class="grouptext1">blah blah blah blah blah blah blah blah </div> </div> <div class="grouptitle2">Group 2 <div class="grouptext2">blah blah blah blah blah blah blah blah </div> </div> </div> CSS: Code: body { margin-top: 10px; margin-right: 10px; margin-left: 10px; } .title { font-family: "Times New Roman", Times, serif; font-size: 24px; color: #000000; font-weight: bold; background-color: #CCCCCC; border-color: #000000; border-bottom-style: solid; border-bottom-width: thin; width: 100%; float: left; position: relative; } .title_lower_color{ background-color: #666666; border-color: #000000; border-left-style: solid; border-bottom-style: solid; border-right-style: solid; border-right-width: thin; border-bottom-width: thin; border-left-width: thin; border-top-style: solid; border-top-width: thin; width: 100%; height: 40px; float: left; position: relative; } .grouptitle1{ color: #000000; font-style: normal; font-family: "Times New Roman", Times, serif; font-size: 14px; font-weight: bold; position: relative; background-color: #CCCCCC; border-color: #000000; border-style: solid; border-width: thin; margin-top: 10px; width: 300px; float: left; } .grouptitle2{ color: #000000; font-style: normal; font-family: "Times New Roman", Times, serif; font-size: 14px; font-weight: bold; position: relative; background-color: #CCCCCC; border-color: #000000; border-style: solid; border-width: thin; margin-top: 10px; margin-left: 10px; float: left; } .grouptext1 { color: #000000; font-style: normal; font-family: "Times New Roman", Times, serif; font-size: 12px; font-weight: normal; position: relative; background-color: #FFFFFF; border-color: #000000; border-top-style: solid; border-top-width: thin; width: 300px; } .grouptext2 { color: #000000; font-style: normal; font-family: "Times New Roman", Times, serif; font-size: 12px; font-weight: normal; position: relative; background-color: #FFFFFF; border-color: #000000; border-top-style: solid; border-top-width: thin; } I've only just started using CSS rather than tables. The title bit is ok. The problem is the main <div>. In Firefox l can't seem to get the two divs (grouptitle1 & grouptitle2) to float side by side. The only way l can do it is by setting grouptitle2 to a certain width. But l want grouptitle2 to fill the remaining width of the screen whatever size the browser is and not be a set width. Is there any way so that l can make the two divs appear side by side without adding a width to the grouptitle2?? here's a working version: Clicky 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?) 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. 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> 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. 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? 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 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> 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 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 |