Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DIV background behind Float image problem

Status
Not open for further replies.

askari

Technical User
Joined
Oct 29, 2001
Messages
44
Location
AU
Hi, I have a div with text that wraps around a floated image but the problem is that the background behind the text doesnt float along with the text. I want it to resize correctly whether there is an image there or not (as the text currenly does)
Here is the test page:
Thanks!
 
Add this to your stylesheet

Code:
hr {
    clear:both;
    visibility:hidden;
}

Then put a <hr> element after your text (outside the paragraph).

If you need to use <hr> tags elsewhere (and see them) then apply a class to the one used for clearing floats.



Foamcow Heavy Industries - Web design and ranting
Buy Languedoc wines in the UK
 
Thanks guys,
I may not have explained the problem well enough... check the test page again & you will see what I mean (Ive used good old tables to illustrate how I want it to look)

glenmac I see the bug you described Im using IE6
 
If you apply a right hand margin (say 150px) to the .background class you should achieve what you want.

I'm not sure you're constructing what you want in the right way though, but that kind of depends on the context of what the whole page is like.

Foamcow Heavy Industries - Web design and ranting
Buy Languedoc wines in the UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top