PDA

View Full Version : float left


esthera
08-07-2006, 07:40 AM
I have a float with a picture and then text.
how can I make the picture float left but I don't want the text to go under the picture?

(I want the picture to always be left of the text even when the text is longer as if it was a table with 2 cells. (but i don't want to use a table)

_Aerospace_Eng_
08-07-2006, 08:45 AM
Will the width of the image ever change? If not then float the image to the left and give a left margin to the text equal to or greater than the width of the image.

esthera
08-07-2006, 08:51 AM
yes it can change

_Aerospace_Eng_
08-07-2006, 08:54 AM
Then read this http://bonrouge.com/br.php?page=nwfloat

Kravvitz
08-07-2006, 08:59 AM
Try putting a <span> around the text and floating the <span> left as well.

Don't forget to use a clearing technique so the <p> doesn't collapse in standards compliant browsers. (http://www.dynamicsitesolutions.com/css/layout_techniques/#clearing_floats)

esthera
08-07-2006, 09:38 AM
I have the following with the class of floatleft{ float:left}
the picture is not even floating to the left
<h2><a href="/product2">190001</a></h2>
<em class="strapline">title!</em>
<a href="/product2"><img class="floatleft" src="/uploads/images_products/404.jpg" alt="190001" /></a>
<p>Great gift for MOM!

</p>
<p></p>
<div class="price">$7.50</div>

esthera
08-07-2006, 09:47 AM
i now saw your post and tried

<div class=leftimage><a href="190001/p-73-404/"><img class="floatleft" src="/uploads/images_products/404.jpg" alt="190001" /></a>
</div><div class=righttext><p>Great gift for MOM!

</p>
<p></p>
<div class="minprice">$7.50</div>
</div>

and css:

.righttext {
display:table-cell;
}
* html .righttext {
display:inline-block;
}
.leftimage{
float:left;
padding:0 10px;

}

but it still doesn't float -why?

esthera
08-07-2006, 09:59 AM
i see that test works but on my page it doesn't..

what could cause this?
(I Don't want to give links because i don't like my clients sites to be found in google on this forum)