Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / unwanted color behind a floated image.

unwanted color behind a floated image.

Locked

Views: 1,968

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
16 May 2006, 6:05 PM
#1
mrmarcus66 avatar

mrmarcus66

Zen Follower

Join Date:
Oct 2004
Location:
England
Posts:
109
Plugin Contributions:
0

unwanted color behind a floated image.

I have a script that places a image that changes on my main page. but I have a some text next to it. the background colour of the text goes all the way behind the image. The image has been set to float in css. can anyone advise me where I've gone wrong?

http://fetters.myzen.co.uk/shop/

Regards
Mark

16 May 2006, 6:07 PM
#2
mrmarcus66 avatar

mrmarcus66

Zen Follower

Join Date:
Oct 2004
Location:
England
Posts:
109
Plugin Contributions:
0

Re: unwanted color behind a floated image.

I also want the background color from the text box to flow to bottom of the image next to it so it makes a nice rectangle.

16 May 2006, 6:16 PM
#3
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,607
Plugin Contributions:
0

Re: unwanted color behind a floated image.

16 May 2006, 6:53 PM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: unwanted color behind a floated image.

You have several dodgy things going on here (I'm talking about the CSS not the products!)

Firstly, you have a typo in your #thinborderfloat definition. I assume that "lenth" should be "length", but in any case I suspect you really mean "height".

Secondly, whatever package or method you have used to edit your page has created an unnamed <div> around your text in order to insert inline CSS. That's two black marks. The inline CSS would have been better applied to the perfectly good (and named) indexDefaultMainContent div.

Normally I, like Kim, would have sent you off to learn more about floating divs (oh what the hell, you should do this anyway), but in the meantime you have one thing going for you that offers an easy solution ...

Because you want to place your text relative to an image with a fixed size and have only a small amount of text relative to the size of the coloured box in which you want to place it, you could simply do the following: delete out the unnamed div and add its CSS to #indexDefaultMainContent (youll need to create this) along with a margin-left:320px and height:179px