I am working on a mobile site and I have a couple of pages that display a small thumbnail with text to the right: http://sunsetwesterngardencollection.com/mobile/the-collection
The thumbnail positions well, but the text is challenged. I did some research and found one option but it does not seem to work properly.
Here is the HTML for the content:
<ul id="plants">
<li class="plant">
<a href="http://sunsetwesterngardencollection.com/mobile/plant/amistad-salvia"><img src="http://sunsetwesterngardencollection.com/photos/thumbnails/salvia_amistad_thumb.jpg" alt="‘Amistad’ Salvia" />
<span class="plant-name">‘Amistad’ Salvia</span></a>
<div class="orange-slice"></div>
</li>
<li class="plant">
<a href="http://sunsetwesterngardencollection.com/mobile/plant/black-adder-phormium"><img src="http://sunsetwesterngardencollection.com/photos/thumbnails/phormium_black_adder_thumb.jpg" alt="‘Black Adder’ Phormium" />
<span class="plant-name">‘Black Adder’ Phormium</span></a>
<div class="orange-slice"></div>
</li>
<li class="plant">
<a href="http://sunsetwesterngardencollection.com/mobile/plant/blue-riding-hood-penstemon"><img src="http://sunsetwesterngardencollection.com/photos/thumbnails/penstemon_blue_riding_hood_thumb.jpg" alt="‘Blue Riding Hood’ Penstemon" />
<span class="plant-name">‘Blue Riding Hood’ Penstemon</span></a>
<div class="orange-slice"></div>
</li>
</ul>
Here is the CSS:
ul#plants li {
width: 100%;
height: auto;
position: relative;
}
.orange-slice {
width: 100%;
height: 2px;
clear: both;
background: #e1562e;
}
ul#plants li img { float: left; width: 20%; margin: 0; }
ul#plants li span,
ul#plants li span a:link,
ul#plants li span a:visited {
color: #e1562e;
font-size: 1.3em;
font-weight: 500;
position: absolute;
top: 25%;
left: 23%;
text-transform: uppercase;
display: table-cell;
vertical-align: middle;
}
What is the proper way to align text vertically when it is not in a table cell?
Thanks!