limitphp Posted March 4, 2009 Share Posted March 4, 2009 I'm trying to set a left column, a center column (for all content) and a right column. I'm setting the width in the divs by percent.....I tried px just in case...neight is working. Each div seems to remain 100% width and they are stacked on top of each other. here's the code: <div style='border:solid 1px; width='30%' margin-top:25px; float:left'> <font class='h1'>My Account ($username)</font> <p style='line-height:5px'> </p> <a href='javascript: onclick=changeArrow()' class='link5'><b>My Playlists ($playlist_count) <img id='arrow' border='0' src='img/down_arrow.bmp'/></b></a> <p style='line-height:5px'> </p> <div id='list_playlists'></div> </div> <div style='border:solid 1px; width='50%' margin-top:25px; float:left'> <div id='list_songs'></div> </div> <div style='border:solid 1px; width='20%' float:left'align='right'> <p style='line-height:10px'> </p> <font class='t1'><b>$fname $lname</b> <br> $email <br> Joined ".date('F, Y', strtotime($join_date))." </font> </div> Quote Link to comment https://forums.phpfreaks.com/topic/147926-solved-cannot-seem-to-set-div-widths/ Share on other sites More sharing options...
limitphp Posted March 4, 2009 Author Share Posted March 4, 2009 sorry....i put width='50%' instead of width:50%; Quote Link to comment https://forums.phpfreaks.com/topic/147926-solved-cannot-seem-to-set-div-widths/#findComment-776375 Share on other sites More sharing options...
haku Posted March 4, 2009 Share Posted March 4, 2009 Well, it's good to see you are trying out CSS based layouts. One thing though - you should drop the font tags. They are deprecated, and one point of CSS is that it's meant to keep content (HTML) and presentation (CSS) separate. So you should set fonts in CSS. And also on that note, you should take your CSS out of the divs, and make them external, either in the head of your document (which is ok), or in an external document (which is better). This keeps your content and presentation separate, and will also speed up your load times. Good luck! Quote Link to comment https://forums.phpfreaks.com/topic/147926-solved-cannot-seem-to-set-div-widths/#findComment-776390 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.