layout

K

King of Red Lions

Hi, is there anyway of putting two divs side by side without using the
float attribute? Many thanks.
 
N

Neal

King of Red Lions:
Hi, is there anyway of putting two divs side by side without using the
float attribute?

The position property works too. But you cannot reliably put another div
below two absolutely positioned side-by-side divs. Otherwise it's in some
ways better than a float.
 
S

Steve Pugh

Hi, is there anyway of putting two divs side by side without using the
float attribute?

Use the position property.
Use display: table-cell (and/or other table display options).
Use display: inline-block (or inline-table).
Nest them inside an HTML table.
Use frames.

Each has pros and cons. Some of the cons can be quite major.

It often happens that float isn't the best choice but is often the
"least worst" choice.

Steve
 
S

Spartanicus

King of Red Lions said:
is there anyway of putting two divs side by side without using the
float attribute?

float is a css *property* (not attribute)

display:table-cell
display:inline-table
display:inline-block

Browser support varies.

Provide us with information on what you are actually trying to do for
more meaningful help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top