views:

23

answers:

2

There is a picture:

alt text

How to make this inscription so that:

  1. The lines were "separated" - that is between the lines was a gap.
  2. Text aligned left.
  3. The width of the photo is not fixed, it is floating.
  4. The length of the text also not fixed (signatures can be of different lengths).

I need crossbrowser-compatible solution.


I apologize in advance for my English.

If you have a better title for this issue - I will change on your own.

+1  A: 

Have you taken a look at this Text Blocks Over Image tutorial?

sirhc
thank you, i will look.
Kalinin
+1, and not reinventing the wheel is always a plus. I'd take eons figuring out a solid and safe answer when a search would be enough to find one.
ANeves
+1  A: 

Try this: The trick - is usage of table (only one element, which support full functional vertical-align: bottom). To control gap use pairs of parameters (see .text font-size/line-height)

<style>
.frm{
    height:80px;
    vertical-align:bottom;
}
.text{
    margin-bottom:3px;
    background-color:#7f0000;
    color:white;
    font-size:15px;
    line-height:20px;
}
.banner{
    position:relative;
    left:0px;
    top:-80px;
    width:200px;
}
</style>
<div style="float:left;">
        <img src="64462657.jpg" />
<table class="banner" >
<tr>
    <td class="frm">
        <span class="text">OVERRIDE some long-long text there </span>
    </td>
</tr>
</table>

</div>

The only problem - you need specify average width of text (you requirement #3 is satisfied, but for text it could be changed).

Dewfy
`font-size/line-heigh` - good idea!
Kalinin
but in ie6 does not work.
Kalinin
@Kalinin: just tried on IE6, what exactly failed?here is snapshot form IE6: http://img299.imageshack.us/img299/3818/64462657test.jpg
Dewfy
@Dewfy, I can not make a snapshot, but the "gap" between the lines (in ie6) not present.
Kalinin
@Kalinin just try to increase line-height instead of font-size,
Dewfy
@Dewfy, still not working. I tried.
Kalinin