5 replies [Last post]
florent
florent's picture
Offline
Enthusiast
Paris, France
Last seen: 16 years 27 weeks ago
Paris, France
Timezone: GMT+1
Joined: 2003-04-19
Posts: 96
Points: 0

one last prob with one of my pages (with netscape 7 of course Oups ) : http://bbal.chokebore.net/css/audio.html

the image is floating to the right, but it is gliding over the bottom border of the div it is contained in, because there is not enough text to fill said div...

i tried setting the image margin to 20px, but it didn't work.

i also tried <br clear="all"> but this had a very strange effect : the image 'stepped back inside its div' (pardon my french Wink), but the space between the middle and bottom div disappeared ! Shock

anything else i could try ?

I'm a perfectionist
and perfect is a skinned knee

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 4 weeks 1 day ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5344
Points: 2965

floating image escaping its own div !

Hi Florent,
I'm not really sure of what you are trying to achieve.
But here is a suggestion to try.
Set the h1 display style to inline, if that doesn't work try floating it left.

You could also try having another div inside the content excluding the image that floats left.

florent
florent's picture
Offline
Enthusiast
Paris, France
Last seen: 16 years 27 weeks ago
Paris, France
Timezone: GMT+1
Joined: 2003-04-19
Posts: 96
Points: 0

floating image escaping its own div !

this is what i want :

and this is what netscape does :

see how the image steps over the bottom border ? i don't want this to happen...

I'm a perfectionist
and perfect is a skinned knee

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 4 weeks 1 day ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5344
Points: 2965

floating image escaping its own div !

Thanks for the clarification Smile
Set the height of the content container to 100px, the height of the image.

.content {padding:20px; text-align:justify; border:1px solid #000000; margin-bottom:10px; height:100px;}

dJomp
dJomp's picture
Offline
Enthusiast
Last seen: 7 years 18 weeks ago
Joined: 2003-03-23
Posts: 422
Points: 0

floating image escaping its own div !

The other way to do it (if you don't know how big each picture is going to be) is to put the following empty DIV at the bottom of the content DIV:
<div style="clear: both;"></div>
This will force the div below the floating image, so the padding will be below the DIV, and the border hopefully well clear.

You know you're a geek when you try to shoo a fly away from the monitor with your cursor.

florent
florent's picture
Offline
Enthusiast
Paris, France
Last seen: 16 years 27 weeks ago
Paris, France
Timezone: GMT+1
Joined: 2003-04-19
Posts: 96
Points: 0

floating image escaping its own div !

perfect ! thanks very much ! Tongue

I'm a perfectionist
and perfect is a skinned knee