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
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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.