otuatail Posted March 8, 2012 Share Posted March 8, 2012 Hi I am trying to get 2 divs to float left next to each other inside a containing div. .container { border:solid; position:absolute; top:15px; left:20px; width:940px; height:650px; /* border-color:red; border-style:solid */ } .content { border:solid; float:left; padding:10px; width:300px; height:135px; color: #aa8800; /* border-color:red; border-style:solid */ } .content2 { border:solid; padding:10px; width:470px; height:135px; color: #aa8800; } code] [code] <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Christian Views Home</title> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <META http-equiv="imagetoolbar" CONTENT="no"> <link rel="stylesheet" href="stylesheets/ChristianViews2.css" type="text/css"> </head> <body> <form action="submit.php" method="post"> <div class="container"> <div class="content">content<div> <div class="content2">content 2</div> </div> </form> </body> </html> Seems simple but this is crazy. TIA Desmond. Link to comment https://forums.phpfreaks.com/topic/258538-cant-get-divs-to-float-left/ Share on other sites More sharing options...
AyKay47 Posted March 8, 2012 Share Posted March 8, 2012 <div class="content">content<div> you missed the closing div tag, should read <div class="content">content</div> http://jsfiddle.net/hZ6nQ/ Link to comment https://forums.phpfreaks.com/topic/258538-cant-get-divs-to-float-left/#findComment-1325278 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.