开发者

text at the bottom of span

开发者 https://www.devze.com 2023-04-10 22:58 出处:网络
I have something like this <td> <a href=\"#\"> <span class=\"foo\"> Link Text </span>

I have something like this

<td>
    <a href="#">
        <span class="foo">
             Link Text
        </span>
    </a>
</td>

and I have

.foo
{
    height: 90px;
    display: inline-block;
    background: #e8edff url('foo.png') top center no-repeat;
    vertical-align: bottom;
}

and it renders something like this (with the background image)

 ________________
|    Link Text   |
|                |
|                |
|                |
|                |
|________________|

How can i make it so I renders like this?

 ________________
|                |
|                |
|                |
|                |
|    Link Text   |
|________________|

The requirement is the every cell has to have a hyperli开发者_运维知识库nk and a background image and some text at the bottom.

Thanks

EDIT: here's a jsfiddle link of what I'm trying to do.


give vertical-align: bottom; in TD instead of span

EDIT: write like this

.foo
{
    height: 50px;
    background: #e8edff url('http://www.emblemmart.com/emblems-badges-insignias/media/logos/medium/BMW.gif') top center no-repeat;
    display:table-cell;
    vertical-align:bottom;

}

check this http://jsfiddle.net/sandeep/yBKZS/1/


Put the vertical-align: bottom; on the TD not the SPAN.

vertical-align will not do what you want, except in two cases: On a table element, or on (or near) an image. See: http://phrogz.net/css/vertical-align/index.html


add this to the td tag <td valign="bottom">

UPDATE

Here's what you are looking for:

http://jsfiddle.net/yBKZS/3/

UPDATE 2

If you don't need the image to be background you could do something like this:

http://jsfiddle.net/yBKZS/8/


Set the style of the span to

margin-top: 'auto'
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号