Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

text at the bottom of span

Tags:

html

css

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 hyperlink and a background image and some text at the bottom.

Thanks

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

like image 438
Professor Chaos Avatar asked Oct 06 '11 12:10

Professor Chaos


3 Answers

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/

like image 124
sandeep Avatar answered Sep 24 '22 10:09

sandeep


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

like image 33
Ariel Avatar answered Sep 23 '22 10:09

Ariel


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/

like image 40
checkenginelight Avatar answered Sep 24 '22 10:09

checkenginelight