i cant get a smaller (superscript) inline element to align with another inline element.
Basically the em element (that contains the words ‘USD’) should align with the inline text (that contains the words ABC), so both the tops of the words are on the same line.
For me with my code below, the words USD are half way up even though i set the line height to 35px;
Any ideas what i am doing wrong?
Thanks,
Chris
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
.plan-types-pricing
{
font-size: 35px;
line-height: 35px;
}
.plan-types-pricing strong
{
display: block;
}
.plan-types-pricing em
{
font-size:12px;
vertical-align: top;
line-height: 35px;
}
.plan-types-pricing small
{
font-size: 12px;
vertical-align: baseline;
}
</style>
</head>
<body>
<span class="plan-types-pricing">
<strong>Starting at</strong>
<em>USD</em>
ABC
<small>/month</small>
</span>
</body>
</html>
The line-height of
.plan-types-pricing emshould be desired height – font size (35 – 12 = 23)So set the
line-heightofemto23px.