Bogdan
Bogdan

Reputation: 1083

CSS: vertical-align multiple text sizes

I'm having trouble with a text line that has multiple font sizes in it. I want all the text to be aligned to the middle of the .line1 element. I used vertical-align:middle but it doesn't do the trick. Here's the JSfiddle: http://jsfiddle.net/tWxdT/

Upvotes: 0

Views: 785

Answers (3)

Matthew Darnell
Matthew Darnell

Reputation: 4588

You can set the line-height to get better alignment of differently sized text. Not sure it's what you are looking for, but adding a line-height of 2.2em in the example centered the text a bit differently.

Upvotes: 0

Aaron Brewer
Aaron Brewer

Reputation: 3667

Looks fine to me in Google Chrome as well, but may I recommend using display: table-cell; in your CSS as well? If not even that then scrap using Vertical-Align and try having equal amounts of Padding via the Top and Bottom for your HTML Tags.

Upvotes: 0

Ace
Ace

Reputation: 1467

erase all vertical-align in css. and give product_mark_bg a vertical-align:baseline

Upvotes: 2

Related Questions