Jump to content

[SOLVED] Cannot Seem to Set Div Widths


limitphp

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/147926-solved-cannot-seem-to-set-div-widths/
Share on other sites

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!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.