5 replies [Last post]
Freaky
Offline
newbie
Last seen: 17 years 43 weeks ago
Joined: 2004-09-04
Posts: 3
Points: 0

hi,
on http://users.pandora.be/theonlyfreaky/index.html I am trying to make 2 div's float next to each other.
IE 6 is doing fine, but firefox, mozilla and Opera don't seem to get it.
any solutions?

thx.

mkjoker
Offline
Regular
Dresden
Last seen: 17 years 43 weeks ago
Dresden
Timezone: GMT+1
Joined: 2004-09-01
Posts: 40
Points: 0

float problem

Hello Freaky,

you didn't specify the width of your floated elements.

If you set the left one to 28% and the right one to 70% it works fine.

see:
http://www.w3.org/TR/CSS2/visuren.html#floats
http://css.maxdesign.com.au/floatutorial/

mkjoker

Freaky
Offline
newbie
Last seen: 17 years 43 weeks ago
Joined: 2004-09-04
Posts: 3
Points: 0

float problem

thx for the fast reply,

I tried this and it works, but that menu on the left will be loaded dynamically using php.
there is no way of telling the width of the url's that I don't want to get wrapped.

For once IE is doing a great job :s but I really want to make it cross browser.
Is there no way of imitating the IE way?

mkjoker
Offline
Regular
Dresden
Last seen: 17 years 43 weeks ago
Dresden
Timezone: GMT+1
Joined: 2004-09-01
Posts: 40
Points: 0

float problem

To conform to the css standard

Quote:
A floated box must have an explicit width (assigned via the 'width' property

I suggest that you test the width with the longest word you will have as a link (there is probably a limit in your database field) and take that width.

Or try out which maximum width of your menu looks still good and adjust the limit for your link length approbriately. I guess you wouldn't want to have a menu taking 80% of the space and all the content being scrunched in the remaining 20%. Wink

Freaky
Offline
newbie
Last seen: 17 years 43 weeks ago
Joined: 2004-09-04
Posts: 3
Points: 0

float problem

Quote:
I guess you wouldn't want to have a menu taking 80% of the space and all the content being scrunched in the remaining 20%.

good point there, didn't think about that

Quote:
I suggest that you test the width with the longest word you will have as a link (there is probably a limit in your database field) and take that width.

ok, that's what I'll do

thx for the help!

wolfcry911
wolfcry911's picture
Offline
Guru
MA, USA
Last seen: 8 years 17 weeks ago
MA, USA
Timezone: GMT-5
Joined: 2004-09-01
Posts: 3224
Points: 237

float problem

If you really wanted to get fancy, you could use PHP to calculate the length of the urls and adjust the width accordingly.