CSS - Floated Divs Aren't Floating In Firefox
The problem is that I have a wrapper div that will contain two "boxes", one that has a white background one that has a black background. I want the white background box to be to the left of the black background box, but inside the wrapper div which has a red background. It works just fine in IE (which surprised me) but Firefox is doing something really strange. The black background box starts all the way to the left of the wrapper with the white background box on top of it. Not only that, but the text for the black background box starts below the white background box.
I'm new to inserting code, but I'll give it a try: 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"> <head> <title>linking to style sheets 2</title> <style type="text/css"> body { background-color: #ccccff; } h1 { font: bold 20px arial, tahoma, verdana; color: #6633ff; border-bottom: 1px solid #444444; margin: 25px 0; padding: 5px; } p { font: 15px verdana; line-height: 1.5em; color: #000077; margin: 0; padding: 0; } .leftbox { width: 300px; background-color: #ffffff; padding: 10px; margin: 10px 10px; float: left; } .rightbox { width: 300px; padding: 10px; margin: 10px 10px; background-color: #000000; } .wrapper { width: 800px; background-color: #ff0000; } .end { clear: both; } </style> </head> <body> <div class="wrapper"> <div class="leftbox"> <h1>Heading 1</h1> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras pede sem, lobortis tempus, sodales sed, vehicula vitae, lorem. Fusce nec massa id erat lobortis semper. Vestibulum dignissim orci et orci. Fusce quis tortor eu sapien gravida pretium. Sed vel lacus. Aliquam erat volutpat. Pellentesque suscipit imperdiet nibh. Vivamus ut turpis. In leo. Quisque augue. </p> </div> <div class="rightbox"> <h1>Heading 1</h1> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras pede sem, lobortis tempus, sodales sed, vehicula vitae, lorem. Fusce nec massa id erat lobortis semper. Vestibulum dignissim orci et orci. Fusce quis tortor eu sapien gravida pretium. Sed vel lacus. Aliquam erat volutpat. Pellentesque suscipit imperdiet nibh. Vivamus ut turpis. In leo. Quisque augue. </p> </div> <div class="end"></div> </div> </body> </html> You'll see that I've floated the white background div, but again, this is making that div sit on top of the black background div. Can anybody help? P.S. I know this isn't really pleasing to the eye, but it's just for demonstration purposes Similar TutorialsHere's the site in Question: http://www.winchps.vic.edu.au It's a standard fixed width floated DIV columns with a wrapper. One thing it does have is a second DIV inside both columns to display the Gradient background over the top of the repeated background. It works perfect in Firefox & IE7 (with a tweak) but IE6 mkes the sidebar nested div drop below the original sidebar DIV click here for a screenshot for those lucky enough not to have IE6. Here's the CSS code for the basic layout: Code: body { font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; font-size: 12px; text-align: center; margin: 0px 0px 60px 0px; padding:0px; border: 0; line-height: 2; } #header { width: 802px; } #wrapper { width: 802px; margin:0px; padding: 0px; text-align: left; margin: 0 auto; background: url(images/bodybg.jpg) center repeat-y; } #content { padding: 0px; margin: 0px; } #maingrad { background: url(images/winchcontentgrad.jpg) top left repeat-x; padding: 10px; } #main { width: 589px; float: right; background: url(images/winchcontentbg.jpg) repeat; border-left: solid 1px #000; border-right: solid 1px #000; } #mainstop { width: 589px; float: right; background: url(images/winchcontentbg.jpg) repeat; border-left: solid 1px #000; border-right: solid 1px #000; border-bottom: solid 1px #000; font-size: 10px; } #sidebargrad { background: url(images/winchsidebargrad.jpg) top left repeat-x; padding: 10px 5px 0px 10px; } #sidebar { width: 200px; float: left; background: url(images/winchsidebg.jpg) repeat; line-height: 2; font-size: 14px; border-left: solid 1px #000; border-right: solid 1px #000; } I obviously need to put a conditional comment in there, same for what I did for the minor IE7 tweak, but I'm struggling to suss out what's causing it, I haven't found the specific issue on any of the regular sites (PIE etc). Anyone got any ideas? I had my css working fine and then I decided to change the layout and I almost have the new style sheet finished. However, I am trying to divide my header field into 2 columns (each 50% of the width), the left most column will have my banner and the right most column will be split in half (each half being 50% of total height), with 2 rows, one for a search field and the other for my main site navigation. However, the 2 rows are not taking up the 50% of the height that I would like for them to take up. Any ideas as to why? I tried defining min and max height, but that didn't work... Here's my css: Code: /* CSS Document */ h1 { font-family: Geneva, Arial, sans-serif; font-size: 20px; color:#000000; } h2{ font-family: Geneva, Arial, sans-serif; font-size: 16px; color:#000000; } h4{ font-family: Geneva, Arial, sans-serif; font-size: 12px; color:#000000; } /*============================ Begin Layout Structure ============================*/ #wrapper { /* main container for everything */ width: 1024px; min-height: 748px; margin: 0 auto; background: #ffffff; overflow: hidden; /* contain inner floats */ position: relative; /* establish the containing block */ } #accounttypeselector { /* select personal or business to affect page display */ height: 25px; background: #0000FF; } #servicesbar { /* container for user services */ height: 30px; /* 30px should be adequate height */ width: 100%; } #servicesbar-services { /* container for user services once logged in */ float: left; /* push this to left side */ width: 75%; /* want it to be 75% of the servicesbar width */ height: 100%; /* since servicesbar container height is 30px should be 100% of this */ background: #ff00ff; } #servicesbar-login { /* for user login and logout - contained inside servicesbar */ float: left; /* should push this just beside services */ width: 25%; height: 100%; /* since servicesbar container height is 30px should be 100% of this */ background: #8B2323; } #header { /*header for the site - will contain logo, search, and main navigation */ float: left; width: 1024px; height: 100px; } #header-logo { /* will include site banner/logo - will be located on left side */ background: #ff0000; width: 50%; float: left; } #header-rightcol { /* column for search and main nav */ width: 50%; float: left; } #header-rightcol-search { min-height: 50%; max-height: 50%; background: #7FFFD4; } #header-rightcol-navmain { /* navbar that will be located below header */ min-height: 50%; max-height:-50%; background: #21ee00; } #bodywrapper { /* wrapper for main content - will have 3 columns here */ width: 1024px; height: 100%; padding-top: 10; } #bodywrapper-navleft { /* sub nav to be lcoated in left column of bodywrapper */ width: 15%; background: #8B8378; float: left; } #bodywrapper-main { /* main content to be located in middle column of bodywrapper */ width: 60%; background: #66CDAA; float: left; } #bodywrapper-news { /* news column to be located in right column of bodywrapper */ width: 25%; background: #8A2BE2; float: left; } #footer { /* footer to be located at bottom of wrapper */ margin: 0 auto; position: relative; width: 1014px; /* will be 1024 with padding */ height: 20px; padding-right: 10px; } and here's my basic html Code: <!DOCTYPE html> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="test2.css" /> </head> <body> <div id= "wrapper" > <div id= "accounttypeselector" > Lorem ipsum dolor sit amet </div> <div id= "servicesbar" > <div id= "servicesbar-services" > Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</div> <div id= "servicesbar-login" > Lorem ipsum dolor sit amet</div> </div> <div id= "header" > <div id= "header-logo" > Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras volutpat, purus ac pellentesque adipiscing, mauris ligula convallis metus, vitae scelerisque nibh orci quis mi. *** sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur porttitor aliquam libero. Quisque molestie ornare sem. Nam euismod sem lacinia ipsum. In pharetra metus ut dolor cursus aliquam. Maecenas eu ante quis enim tincidunt laoreet. Pellentesque varius nunc in ipsum pulvinar sollicitudin. Nunc et mi. Donec auctor dignissim orci. Aliquam sed magna. Pellentesque in dui. In eget elit. Praesent eu lorem.</div> <div id= "header-rightcol" > <div id= "header-rightcol-search" > Lorem ipsum dolor sit amet, consectetuer adipiscing elit. </div> <div id= "header-rightcol-navmain" > Lorem ipsum dolor sit amet, consectetuer adipiscing elit. </div> </div> </div> <div id= "bodywrapper" > <div id= "bodywrapper-navleft" > Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras volutpat, purus ac pellentesque adipiscing, mauris ligula convallis metus, vitae scelerisque nibh orci quis mi. *** sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur porttitor aliquam libero. Quisque molestie ornare sem. Nam euismod sem lacinia ipsum. In pharetra metus ut dolor cursus aliquam. Maecenas eu ante quis enim tincidunt laoreet. Pellentesque varius nunc in ipsum pulvinar sollicitudin. Nunc et mi. Donec auctor dignissim orci. Aliquam sed magna. Pellentesque in dui. In eget elit. Praesent eu lorem. </div> <div id= "bodywrapper-main" > Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras volutpat, purus ac pellentesque adipiscing, mauris ligula convallis metus, vitae scelerisque nibh orci quis mi. *** sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur porttitor aliquam libero. Quisque molestie ornare sem. Nam euismod sem lacinia ipsum. In pharetra metus ut dolor cursus aliquam. Maecenas eu ante quis enim tincidunt laoreet. Pellentesque varius nunc in ipsum pulvinar sollicitudin. Nunc et mi. Donec auctor dignissim orci. Aliquam sed magna. Pellentesque in dui. In eget elit. Praesent eu lorem. </div> <div id= "bodywrapper-news" > Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras volutpat, purus ac pellentesque adipiscing, mauris ligula convallis metus, vitae scelerisque nibh orci quis mi. *** sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur porttitor aliquam libero. Quisque molestie ornare sem. Nam euismod sem lacinia ipsum. In pharetra metus ut dolor cursus aliquam. Maecenas eu ante quis enim tincidunt laoreet. Pellentesque varius nunc in ipsum pulvinar sollicitudin. Nunc et mi. Donec auctor dignissim orci. Aliquam sed magna. Pellentesque in dui. In eget elit. Praesent eu lorem. </div> </div> </div> <div id= "footer" > Lorem ipsum dolor sit amet, consectetuer adipiscing elit. </div> </body> </html> Thanks in advance and any suggestions would be greatly appreciated. Hello all. I have the following code: 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" xml:lang="en" lang="en"> <head> <title>My Site</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <style type="text/css"> #base { border-top: 1px solid #ffffff; border-bottom: 1px solid #ffffff; background: #c0c0c0; } /* end #base */ #main_block { margin: auto; text-align: left; width: 955px; } /* end #main_block */ #main_content, #main_content_2c, #main_content_3c { background: #ffffff; border-left: 1px solid #575757; border-right: 1px solid #575757; } #top_main_content { padding-top: 1em; } #top_main_content ul { float: left; padding: 0; margin: 0; list-style-type: none; border-top: 1px solid #f1f1f1; } /* end #top_main_content ul */ #top_main_content ul li { text-align: right; border-bottom: 1px solid #f1f1f1; } /* end #top_main_content ul li */ #top_main_content ul li a { line-height: 26px; display: block; color: #686868; width: 266px; } /* end #top_main_content ul li a */ .indent { margin-right: 1.5em; } #top_main_content #rotating { z-index: 0; float: right; width: 687px; height: 242px; border-bottom: 1px solid #f1f1f1; border-top: 1px solid #f1f1f1; } /* end #top_main_content img */ #top_main_content #rotating p, #top_main_content #rotating h1 { margin: 2em 0 0 2em; } #sidemenu12, #sidemenu11, #sidemenu13, #sidemenu14, #sidemenu15, #sidemenu16, #sidemenu17, #sidemenu18, #sidemenu22 { width: 687px; height: 242px; font-weight: bold; overflow: hidden; position: absolute; visibility: visible; } </style> </head> <body> <div id="base"> <div id="main_block"> <div id="main_content"> <div id="top_main_content"> <ul> <li><a id="sidemenu11_link" href="#"><span class="indent">Link 1</span></a></li> <li><a id="sidemenu22_link" href="#"><span class="indent">Link 2</span></a></li> <li><a id="sidemenu12_link" href="#"><span class="indent">Link 3</span></a></li> <li><a id="sidemenu13_link" href="#"><span class="indent">Link 4</span></a></li> <li><a id="sidemenu14_link" href="#"><span class="indent">Link 5</span></a></li> <li><a id="sidemenu15_link" href="#"><span class="indent">Link 6</span></a></li> <li><a id="sidemenu16_link" href="#"><span class="indent">Link 7</span></a></li> <li><a id="sidemenu18_link" href="#"><span class="indent">Link 8</span></a></li> <li><a id="sidemenu17_link" href="#"><span class="indent">Link 9</span></a></li> </ul> <div id="rotating"> <div id="default_div"><p>Default</p></div> <div id="sidemenu11"><p>Section 1</p></div> <div id="sidemenu12"><p>Section 2</p></div> <div id="sidemenu13"><p>Section 3</p></div> <div id="sidemenu14"><p>Section 4</p></div> <div id="sidemenu15"><p>Section 5</p></div> <div id="sidemenu16"><p>Section 6</p></div> <div id="sidemenu17"> <p>Section 7 - A<br /> <a href="#">Link 1</a></p> <p><a href="#">Link 2</a></p> <p>Section 7 - B<br /> <a href="#">Link 1</a><br /> <a href="#">Link 2</a><br /> <a href="#">Link 3</a></p> </div> <div id="sidemenu18"><p>Section 8</p></div> <div id="sidemenu22"><p>Section 9</p></div> </div> </div> </div> </div> </div> </body> </html> Which if you look at it in a browser looks rather messy but I have javascript that hides and shows things. But my question is why aren't the links clickable in Firefox. They are in IE7, IE6, and Opera but not Firefox or Safari. I know that if I remove position: absolute from the last set of styles that it will work but then everything isn't stacked on top of each other. I am new to css, and am eager to build the equivalent of a work-week calendar using only css. Basically, a five item table without using table tags. I have succeeded with firefox, but for some reason I am getting an odd reordering of the div elements in IE. I will post the html and the css below, and could really use some pointers. I am sure it has something to do with the float commands, but am not even sure what to call this problem to search for it! Here's the html page <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <link rel="stylesheet" type="text/css" href="killmer.css"> <title>Killmer's Science Page - Chemistry Assignments</title> </head> <body > <div class="left"> <h1><a href="chemcalendar.html" class="one">Chemistry Calendar</a></h1> </div> <div class="left"> <h1>Chemistry Textbook Online</h1> </div> <div class="left"> <h1>Chemistry Today Calendar</h1> </div> <div class="left"> <h1>Chemistry Today Textbook Online</h1> </div> <div class="right"> <img src="./images/logo.jpg" ></img> </div> <div class="right"> <h2>Chemistry Daily Assignments</h2>. </div> <div class="right"> <div class="monday"> <h1>MONDAY</h1> </div> <div class="tuesday"> <h1>TUESDAY</h1> </div> <div class="wednesday"> <h1>WEDNESDAY</h1> </div> <div class="thursday"> <h1>THURSDAY</h1> </div> <div class="friday"> <h1>FRIDAY</h1> </div> <div class="monday"> <h1>MONDAY</h1> </div> <div class="tuesday"> <h1>TUESDAY</h1> </div> <div class="wednesday"> <h1>WEDNESDAY</h1> </div> <div class="thursday"> <h1>THURSDAY</h1> </div> <div class="friday"> <h1>FRIDAY</h1> </div> </div> </body> </html> And here's the css a.one:link {color:black; text-decoration: none;} a.one:visited {color:black; text-decoration: none;} a.one:hover {color:red; text-decoration: none;} a.one:active {color:black; text-decoration: none;} body { background: url(./images/backgroundblend.jpg); background-repeat: repeat-y; background-color:black; } h1 { color:black; font-family:"times new roman",serif; font-size:100%; } h2 { color:silver; font-family:"times new roman",serif; } div.left { border:black; padding:3px; border-style:outset; border-width:2px; background-color:silver; width:150px; font-family:courier, monospace; float:left; clear:left; margin:5px; } div.right { margin-left:250px; margin-top:0px; margin-right:0px; margin-botton:0px; padding:0px; } div.monday { border:black; padding:3px; border-style:outset; border-width:2px; background-color:silver; width:15%; font-family:courier, monospace; margin:1px; float:left; clear:left; } div.tuesday { border:black; padding:3px; border-style:outset; border-width:2px; background-color:silver; width:15%; font-family:courier, monospace; margin:1px 1px 1px 1px; float:left;} div.wednesday { border:black; padding:3px; border-style:outset; border-width:2px; background-color:silver; width:15%; font-family:courier, monospace; margin:1px 1px 1px 1px; float:left; } div.thursday { border:black; padding:3px; border-style:outset; border-width:2px; background-color:silver; width:15%; font-family:courier, monospace; margin:1px 1px 1px 1px; float:left; } div.friday { border:black; padding:3px; border-style:outset; border-width:2px; background-color:silver; width:15%; font-family:courier, monospace; margin:1px 1px 1px 1px; float:left; } Thanks for the time! Hey all, please check this page: http://www.trshady.com/eminemdownloads/ You'll see for floated grev divs. These are working well but the red sentence underneath is not adding margin like it should and it seems the block element is starting in line with the 1st floated div when it shouldn't as the width is too large. I'm unable to use clear as that would place the red sentence below the left hand menu which is floated.Any idea what I could do here? The only solution I see is to wrap the four boxes within a div and add a height larger then all boxes, but there must be a straight forward method. Cheers I have a 3 column layout. Each column may contain one or two articles with a border at the bottom of each article. The There are two borders between the three columns. I'm trying to use floated divs as containers for each of the columns, with a left-hand border in the center and right columns. You can see a non-css example at: http://www.sananselmopreschool.org/pilot/ Well, no matter what I do, I haven't been able to get the column containers to extend to the bottom of the page in IE. If I set them to height:100%, they seem to shoot out to 150% or so. body { height:100%; padding:0; margin:0; background-color:#ECF6DD; font-family: Tahoma; font-size: 11px; color: #707070; text-align:center; border: 1px solid purple; } .body_container { position: relative; height:100%; width:100%; left: 0px; border: 1px groove darkred; } .body_position_center { height:100%; position:relative; width:780px; margin-right: auto; margin-left: auto; border-collapse:collapse; border: 1px solid #999 ; } .header { padding:0; margin:0; position:relative; width:766px; height:195px; } .leftblock { position: relative; height:100%; border-left:3px dotted #228B22; float:left; width:250px; } .centerblock { position: relative; height:100%; border-left:3px dotted #228B22; float:left; width:250px; } .rightblock { position: relative; height:100%; border-left:3px dotted #228B22; float:left; width:250px; } .blockcontents { padding-top:14px; padding-bottom:14px; border-bottom : 3px dotted #228B22; text-align:left; } Any suggestions would be appreciated. I haven't used much javascript, so unless I can see an example, it might be tough to work out a javascript solution. Hi, I'm trying to redesign my website to be CSS and XHTML compliant. While I've managed it and everything is almost perfect, IE has one very minor glitch. The page is http://hiveworldterra.ibboard.co.uk/HWTv2.html My 3-col design is based on (and modified from) a 3 col layout I found on the net (there is a credit in the CSS of the page).IE displays everything perfectly and even resizes horizontally without a problem, but as soon as you try to resize vertically, the left column will often overlay the center column. Refreshing the page without resizing the window fixes it and resizing the page horizontally fixes it. As per usual, Firefox is perfectly fine, no matter how you resize the page (until you get down to rediculously small, at which point its to be expected!) It doesn't seem to be a width issue, as I've got a 1280x1024 monitor at work and at full width on one monitor or down at 500px wide there are only a handful of vertical sizes where the left column doesn't overlap, but every time it does overlap then if you resize horizontally by a single pixel then it fixes itself. Anyone have any ideas or IE only hacks (preferably neat ones!) to stop this minorly annoying behaviour? From problems I had while modifying the original layout, it almost seems as if IE is losing the float on the left column. Thanks Hi, I have managed to rewrite my three column navigation page using floated divs instead of its original table (the page was written years ago and I am updating to get away from tables). This was hard for me because I am very new to CSS. My code validated and the page looks fine in IE but in Firefox the third or right column does not clear the middle column. I tried to google the problem but the explanations are way over my head. Also the only way I could get the blue border to not show up in firefox was to add the style directly to the image code. Can someone please help me. The link is www.medeaslair.net/myths.html. Here is the CSS 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> <title>Greek Myths</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="author" content="Rose A. Rosencrans" /> <style type="text/css"> body { text-align: center; padding-top: 45px; background-image: url("images/tan_marble3.jpg"); color: black; font-family: papyrus; font-weight: bold; font-size: 15px; } a:link { color: blue; } a:visited { color: green; } a image { border-style: none; } #container { margin: 0 auto; width: 750px; text-align: left; } #columnone { float: left; margin: 0; width: 250px; padding-top: 45px; } #columntwo { float: left; width: 250px; padding-top: 45px; } #columnthree { float: right; clear: both; padding-top: 25px; } h1 { text-align: center; } h3 { text-align: center; } #email { text-align: center; text-decoration: none; padding-top: 150px; border: 0; } ul { margin: 0 auto width: 750px; } li { text-size: 12px; text-decoration: none; padding-right: 4px; margin: 0 auto; margin-bottom: 2px; border-style: none; list-style-type: none; } </style> </head> Here is the HTML Code: <body> <div id="container"> <img src="images/grapes-l.gif" style="float: left; width: 70px; height: 85px;" alt="Grapes" title="Grapes" /> <img src="images/grapestran.gif" style="float: right; width: 70px; height: 85px;" alt="Greek Man" title="Greek Man" /> <h1>Tales of Greek Mythology</h1> <img src="images/bar66.gif" style="float: left; padding-left: 100px; width: 420px;" alt="Vine" title="Vine" /> <br /> <div id="columnone"> <ul> <li style="font-size: 15px; text-decoration: underline; padding-bottom: 4px;">Gods and Goddesses</li> <li><a href="aphrodite.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Aphrodite</li> <li><a href="apollo.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Apollo</li> <li><a href="artemis.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Artemis</li> <li><a href="athena.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Athena</li> <li><a href="dionysus.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Dionysus</li> <li><a href="hades.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Hades</li> <li><a href="hera.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Hera</li> <li><a href="hermes.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Hermes</li> <li><a href="poseidon.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Poseidon</li> <li><a href="zeus.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Zeus</li> <li style="font-size: 15px; text-decoration: underline; padding-top: 210px; padding-bottom: 4px;">Tales of Love and Woe</li> <li><a href="hermes.html#baucis"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Baucis and Philemon</li> <li><a href="cupid.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Cupid and Psyche</li> <li><a href="pan.html#echo"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Echo and Narcissus</li> <li><a href="pan.html#endymion"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Endymion</li> <li><a href="artemis.html#orion"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Orion</li> <li><a href="orpheus.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Orpheus and Eurydice</li> <li style="font-size: 15px; text-decoration: underline; padding-top: 60px; padding-bottom: 4px;">Giants and Beasts</li> <li><a href="artemis.html#otus"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Otus and Ephialtes</li> <li><a href="minotaur.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>The Minotaur</li> <li><a href="cyclopes.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>The Cyclopes</li> </ul> </div> <!-- end of columnone div --> <div id="columntwo"> <ul> <li style="text-size: 15px; text-decoration: underline;">Men and Heroes</li> <li style="padding-top: 4px;"><a href="atreus.html#agamemnon"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Agamemnon</li> <li><a href="atreus.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Atreus</li> <li><a href="daedalus.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Daedalus and Icarus</li> <li><a href="athena.html#erichthonius"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Erichthonius</li> <li><a href="heracles.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Heracles</li> <li><a href="apollo.html#hyacinthus"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a> Hyacinthus</li> <li><a href="hera.html#ixion"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Ixion</li> <li><a href="atreus.html#orestes"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a> Orestes</li> <li><a href="dionysus.html#pentheus"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a> Pentheus</li> <li><a href="perseus.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Perseus</li> <li><a href="phrixus.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Phrixus</li> <li><a href="pandora.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Prometheus</li> <li><a href="hades.html#sisyphus"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a> Sisyphus</li> <li><a href="atreus.html#tantalus"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a> Tantalus</li> <li style="text-size: 15px; text-decoration: underline; padding-top: 42px;">Tales of The Sea</li> <li style="padding-top: 4px;"><a href="sea.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /> </a>Sea Myths</li> <li><a href="circe.html#glaucus"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Glaucus and Scylla</li> <li><a href="sea.html#nereus"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Nereus</li> <li><a href="sea.html#sirens"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>The Sirens</li> <li><a href="sea.html#triton"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Triton</li> <li style="text-size: 15px; text-decoration: underline; padding-top: 100px;">Tales of Interest</li> <li style="padding-top: 4px;"><a href="garden.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Mythic Garden</li> <li><a href="samhain.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Blessed Samhain </li> <li><a href="thor.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Thor</li> <li><a href="links.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Links and Credits </li> </ul> </div> <!-- end of columntwo div --> <div id="columnthree"> <ul> <li style="text-size: 15px; text-decoration: underline; padding-top: 20px;">Women and Witches</li> <li style="padding-top: 2px;"><a href="heracles.html#alcmene"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Alcmene</li> <li><a href="athena.html#arachne"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Arachne</li> <li><a href="circe.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Circe</li> <li><a href="dionysus.html#erigone"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Erigone and Icarius</li> <li><a href="zeus.html#europa"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Europa</li> <li><a href="zeus.html#io"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Io</li> <li><a href="zeus.html#leda"><img src="images/grape.gif" style="border-style: none;" style="border-style: none;" alt="grapes" /></a>Leda</li> <li><a href="leto.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Leto</li> <li><a href="medea.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Medea</li> <li><a href="leto.html#niobe"><img src="images/grape.gif" style="border-style: none;" style="border-style: none;" alt="grapes" /></a>Niobe</li> <li><a href="pandora.html#pandora"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a> Pandora</li> <li><a href="persephone.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Persephone</li> <li><a href="dionysus.html#semele"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Semele </li> <li><a href="pan.html#syrinx"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Syrinx</li> <li style="text-size: 15px; text-decoration: underline; padding-top: 42px;">Satyrs and Centaurs</li> <li style="padding-top: 4px;"><a href="chiron.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Chiron</li> <li><a href="dionysus.html#midas"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>King Midas </li> <li><a href="apollo.html#marsyas"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a> Apollo and Marsyas</li> <li><a href="chiron.html#nessus"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Nessus</li> <li><a href="pan.html"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a>Pan</li> <li><a href="chiron.html#peirithous"><img src="images/grape.gif" style="border-style: none;" alt="grapes" /></a> Peirithous</li> </ul> </div> <!-- end of columnthree div --> </div> <!-- end of container div --> </body> </html> Hi, I'm having an interesting problem. I have a left floated containing div and then a right floated containing div to split multiple contents between the left and right side of a popup window. It works great in IE 7, Chrome, FF3, but for some reason not in FF2. In FF2, it forces the contents of the right floated containing div below the left floated div (instead of beside it) and makes it's width the entire width of the popup. Any idea why? (there is a reason I had to put all the css directly in the code - normally it's separated) Here's the code: Code: <div style='padding: 15px; text-align: left;'> <div style='float: left;'> <table style='margin-top:16px; font-size: 12px; font-family: Verdana,Arial,sans-serif;'> <tr> <td>Name:</td><td colspan='2'><input id='popupName' name='popupName' style='float:left' type='text'></td> </tr> <tr> <td style='padding:5px 0 17px 0;'>Type:</td><td style='padding:5px 0 17px 0;' colspan='2'><select id='popupType' name='popupType' style='float:left; width: 148px; height: 21px' ></select></td> </tr> <tr> <td style='padding-bottom: 14px;' colspan='3'><div style='width: 280px'>This is some text.</div></td> </tr> <tr> <td style='padding-bottom: 5px;'>Group Title:</td><td style='padding-bottom: 5px;'><input id='popupGroupTitle' name='popupGroupTitle' style='float:left' type='text'></td><td></td> </tr> <tr> <td>Titles:</td><td><input id='popupTitles' name='popupTitles' style='float:left' type='text'></td><td><input style='float:left; padding: 0;' type='button' value='Add >>' onclick=\"addToList()\"></td> </tr> </table> </div> <div style='float: right;'> <div style='margin-bottom:5px;'>Element Titles:</div> <select id='newOptionSelect' style='float:right; width: 247px;' size='12'></select> <input id='popupDeleteBtn' style=\"clear: right; background: rgb(190,190,190) url('/url') no-repeat center center; float:right; margin: 5px 2px;\" type='button' onclick='removeFromList(\"newOptionSelect\", newOptionArray)'/> <input id='popupMoveDownBtn' style=\"float:right; background: rgb(190,190,190) url('/url') no-repeat center center; margin: 5px 2px;\" type='button' onclick='moveDown(\"newOptionSelect\", newOptionArray)'/> <input id='popupMoveUpBtn' style=\"background: rgb(190,190,190) url('/url') no-repeat center center; float:right; margin: 5px 2px;\" type='button' onclick='moveUp(\"newOptionSelect\", newOptionArray)'/> </div> </div> </div> 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... 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 Hi, If I have Code: #parent { background-color: red; padding: 2px; margin: 2px; } #child1 { float: left; } #child2 { float: left; } </style> <div id="parent"> <div id="child1"> Some text </div> <div id="child2"> Some text 2 </div> </div> Then the two child divs will appear underneath the parent one, whereas I want the background from the parent one to be the backdrop for the two child divs. if I remove float: left then they appear in it, but underneath each other. I want them side by side. Is this possible with css? Hello all, sorry if this is a "newb" question, but I am having trouble with the code on my site. The element "#arrival" is not displaying the proper height unless I literally type code in to fill it up the full 400px. I haven't implemented any paragraph styles, I just want to get the basic elements done for this landing page. How would I go about fixing this? Also, do I have to "float" the "#arrival" element? I would like to have the dog house overlap the first div element of the dog jumping (#dog) like in the jpg. Any help would be greatly appreciated. Here is what it should like: http://i33.tinypic.com/2uh7evm.jpg But this is actually what is happening: http://www.amandambruce.com/DROH/index.html Thanks in advance, Amanda p.s. here is the code directly from the source: Code: <!DOCTYPE html PUBLIC "-//w3c//DTD XHTML 1.0 Transitional//EN" "(URL address blocked: See forum rules)"> <html xmlns="html://(URL address blocked: See forum rules)/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>The Dachsund Rescue of Houston</title> <style type="text/css"> body{ background: url(images/background.jpg) no-repeat top center;} #contain{ width: 800px; height: auto; margin-left: auto; margin-right: auto; } #menu{ width: 466px; height: 98px; float: right; margin-top: 15px; } #dog{ width: 491px; heigth: 257px; margin-top: 19px; margin-left: 22px; float: left; } /* margin-top is the menu plus the remaining pixels (19) so, from the very TOP of the page. I guess you keep "adding" */ #community{ float: right; background: url(images/community_spot.jpg) no- repeat; width: 231px; height: 259px; margin-top: 19px; margin-right: 22px; } #arrival{ clear: right; background: url(images/arrivals.png) no-repeat; width: 800 px; height: 400 px; } p{ font-family: helvetica; font-size: 12pt; color: #000000; padding-left: 10px; margin-right: 10px; } </style> </head> <body> <div id="contain"> <div id="menu"> <a href="about.html"><img src="images/about_btn.png" alt="About button" title="About" border="0"/></a> <a href="adopt.html"><img src="images/adopt_btn.png" alt="Adopt button" title="Adopt" border="0"/></a> <a href="help.html"><img src="images/help_btn.png" alt="Help button" title="Help DROH" border="0"/></a> <a href="resources.html"><img src="images/resources_btn.png" alt="Resources button" title="Resources" border="0"/></a> <a href="contact.html"><img src="images/contact_btn.png" alt="Contact button" title="Contact" border="0"/></a> </div> <div id="dog"> <img src="images/jumping.jpg" border="0"/> </div> <div id="community"> </div> <div id="arrival"> lll </div></div> </body> </html> Reply With Quote Hi there! I'm using this code: CSS: Code: #content { margin-top: 75px; width: 597px; height: auto; } #left { width: 110px; height: 497px; margin: 0px; padding: 0px; float: left; } #right { width: 485px; height: 100px; } HTML: Code: <div id="content"> <div id="left"> </div> <div id="right"> </div> </div> --------- But the right-div goes under or over the left-div. I've tried clear:both; between the div's, but it didn't help. URL [code] <div id="wrapper" style="background-color:black;padding:2px;overflow:visible;"> <div id="left-floating-box" style="background-color:red;float:left;">asdfsadf</div> <div id="right-floating-box" style="background-color:blue;float:right;">asdfsadf</div> </div> [code] here is a problem, warpper div doesnt strech to the height of the floating divs, ofcourse when you get rid of floating then everything work but i need this to work as it intended and that is two floating boxes with in one div and this div would wrap around two floating boxes and that way background would stretch as well. I rember solving this problem. Long time ago, but for some reason i am stock right now with this problem. Any one can refresh or sugest anything. Thank you. I've used divs before and got them to work just fine. I've read previous posts and can't find the answer I'm looking for because it seems so basic. But here is my problem. I simply can't get the divisions to float left or right. They just sit on top of one another. Here is my style sheet code: Code: #container { margin: 0px; padding: 0px; width: 800px; } #header { margin: 0px; padding: 0px; background-color: Blue; } #menu { background-color: Gray; float: left; margin: 0px; padding: 0px; width: 140px; } #content { float: right; margin: 0px; padding: 0px; width: 650px; } #footer { margin: 0px; padding: 0px; width: 800px; } and my HTML: Code: <div id="container"> <div id="header" align="center"> <!-- #INCLUDE VIRTUAL="includes/example_header.aspx" --> </div> <div id="midsection" align="center"> <div id="menu"> <!-- #INCLUDE VIRTUAL="includes/example_menu.aspx" --> </div> <div id="content"> <!-- #INCLUDE VIRTUAL="includes/example_common_content.aspx" --> <p> Garbage. </p> </div> </div> <div id="footer" align="center"> <!-- #INCLUDE VIRTUAL="includes/example_footer.aspx" --> </div> </div> Thanks in advance for your help. hi, this might be a simple question: i have a "sidebar" div and a "img-content" div. I floated "sidebar" left and "img-content" right. i want them to be side-by-side. in IE6, the "img-content" div is to the right of "sidebar," but is also below it. in other browsers, they sit side-by-side (which is what i want). this must be a common problem, so before i post my code, wondering if anyone can point me to the fix/hack to get the 2 divs to sit side-by-side in IE6? thanks, tim What I have: I have a <div id="content"> that contains the main content of the site. In this <div> I have two other <div>s that are arranged in columns, using float. The left column forms the Navigation for the site and is surrounded by a black border. Here is the problem: If the content on the right is small, the border on the left stretches from top to bottom (since the left div controls the height). However, when there is a lot of content on the right, the border on the left only surrounds the content of the left div and leaves space underneath the bottom border-line. My question: Is there a way to "stretch" the left div so the border touches the top of its parent div on top and the bottom of its parent div on the bottom? Or in other words: Can I force the left div to have the same height as the right div? Here is an example of what I have right now (before tackling the problem): CSS: Code: #content { width: 800px; margin: 0; padding: 0; } #contentNav { width: 140px; float: left; border: thin solid black; margin: 0; padding: 0; } #contentMain { width: 600px; float: right; margin: 0; padding: 0; } HTML: Code: <div id="content"> <div id="contentNav"> <a href="">Link1</a><br /> <a href="">Link2</a><br /> <a href="">Link3</a><br /> </div> <div id="contentMain"> <p>Here comes a lot of text that spans over many lines. </div> </div> |