Reputation: 7026
I have a button which I'm using multiple times in my webpage. The buttons styles will be as
As shown in the fiddle
http://jsfiddle.net/xzBaZ/4/
I'm using he same css for the button class. I need to align the Text Vertically to center if it is the first case. and no extra alignment is required for other cases.
How can I do this??
Upvotes: 0
Views: 57
Reputation: 1160
You should Write the text in span
<button onclick="return false" class="super button"><span>Awesome Button »
</span> <img src="/Buttons5/add-to-cart-light.png" alt="" width="28" height="20"/>
and also specify the css for span
.button span{
float:left;
margin-top:3px;
}
Upvotes: 1
Reputation: 191729
vertical-align: bottom
on the <img>
or make the image and the text equal line heights. The latter requires you to know the image height beforehand.
Upvotes: 1