2012-05-03 7 views
1

他のインライン要素に合わせるために、より小さな(上付きの)インライン要素を取得できません。CSSが要素を垂直に並べ替えることができません

基本的にem要素( 'USD'という単語を含む)は、インラインテキスト(ABCという単語を含む)と一直線に並んでいる必要があります。以下の私のコードで私にとっては

、言葉のUSDは、私は35pxに行の高さを設定していても途中までです。

私が間違っていることは何ですか? .plan-types-pricing emの行の高さは、高さが所望されるべきである

<!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> 
+0

あなたはこれをどうぞよろしくお願いします。 – RSM

+0

try line-height:50px;それらの... –

答えて

1

おかげで、

クリス - フォントサイズ(36 - 12 = 23)が23pxemline-heightを設定 。

.plan-types-pricing em 
{ 
    line-height: 23px; 
    font-size: 12px; 
    vertical-align: top; 
} 
関連する問題