Old 16-10-2006, 21:51   #1 (permalink)
dougmays
Registered User
 
Join Date: Oct 2006
Location: Ft. Lauderdale, FL.
Posts: 90
Send a message via AIM to dougmays
2 columns

i still haven't conquered a good method of displaying to divs side by side to form to columns.

right now i'm trying

.one{width:20%}
.two{width:80%}

<html>
<body>
<div class=one></div>
<div class=two></div>
</body>
</html>

puesdo code anyone have any better methods?

thanks
  Reply With Quote
Old 16-10-2006, 22:05   #2 (permalink)
.Ryan
Senior Member
 
.Ryan's Avatar
 
Join Date: Jun 2006
Posts: 295
float:left;

on one.
  Reply With Quote
Old 16-10-2006, 22:12   #3 (permalink)
dougmays
Registered User
 
Join Date: Oct 2006
Location: Ft. Lauderdale, FL.
Posts: 90
Send a message via AIM to dougmays
is there a good way to do it without using floats?
  Reply With Quote
Old 16-10-2006, 23:26   #4 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
Not really. You could use positioning, but that can get really messy really quickly.

You'll want to float both of them also.
  Reply With Quote
Old 17-10-2006, 15:51   #5 (permalink)
dougmays
Registered User
 
Join Date: Oct 2006
Location: Ft. Lauderdale, FL.
Posts: 90
Send a message via AIM to dougmays
ok...kinda on the same line. i've noticed if you float the 2 and set them to the width that added together equals the width....and no borders. alot of times the right most one will got the next line. cause it runs out of space. do divs have border widths even if there are nonde in the css
  Reply With Quote
Old 17-10-2006, 17:33   #6 (permalink)
freelancr
Senior Member
 
freelancr's Avatar
 
Join Date: Oct 2006
Posts: 2,305
its always best to leave a gap between the divs anyway, so just make one 20% and the other 75%.
  Reply With Quote
Old 17-10-2006, 18:34   #7 (permalink)
SeanMedia
Senior Member
 
SeanMedia's Avatar
 
Join Date: Jun 2003
Location: Belfast, Ireland
Posts: 416
Send a message via MSN to SeanMedia Send a message via Skype™ to SeanMedia
and make sure you use:

Code:
* { margin:0; padding:0; }

at the top of your CSS file to stop different browsers using their different defaults.
  Reply With Quote
Old 17-10-2006, 20:10   #8 (permalink)
R1gM
Senior Member
 
R1gM's Avatar
 
Join Date: Sep 2006
Posts: 276
Also if you use a container and you want a background to scale with the columns use a clear:both div at the bottom./
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8