Float text over image in table cell

I am trying to float text over an image in the third column of the first row inside the table. This cell has <img>inside it (processed by the psd slice), and I want to put text over it. I tried float: leftand position: absolutebut nothing works.

Any ideas?

+3
source share
2 answers

position:absolutecombined with z-indexshould work.

If this is possible in your design, you can also use the image as the background of the table cell and just put the text in its contents.

: . , IE .

+7

( ), , :

<td style="position:relative;">
    <img src="..." style="position:absolute;z-index:1;" />
    <div style="z-index:2;position:relative;">your text goes here</div>
</td>

.

+4

Source: https://habr.com/ru/post/1770189/


All Articles