dtとddで横並びのソースを作成しました。
上下の線の中で、dtとdd、どちらも上下中央寄せにしたいのですが、
ddだけ上寄せのまま修正できずにいます。
(ちなみにdtは左寄せ、ddは右寄せにしたいです。)
恐れ入りますが、よろしくお願いいたします。
ソースは以下です。
HTML
1<!DOCTYPE html> 2<html lang="ja"> 3<head> 4 <meta charset="UTF-8"> 5 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 6 <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> 7 <meta name="format-detection" content="telephone=no"> 8 9 <style> 10 11 /* Reset and Base */ 12 html { overflow-y:scroll; } 13 body { font-family:Meiryo, 'MS PGothic', arial, sans-serif; } 14 dl, dt, dd { margin:0; padding:0; line-height:1.6; } 15 pre { 16 font-family:Meiryo, 'MS PGothic', arial, sans-serif; border:0; font-size:1.4rem; line-height:1.6; background:#fff; 17 white-space:-moz-pre-wrap; 18 white-space:-pre-wrap; 19 white-space:-o-pre-wrap; 20 white-space:pre-wrap; 21 word-wrap:break-word; 22 } 23 * { 24 -webkit-box-sizing:border-box; 25 -moz-box-sizing:border-box; 26 -o-box-sizing:border-box; 27 -ms-box-sizing:border-box; 28 box-sizing:border-box; 29 } 30 .cf:before { content:''; display:table; } 31 .cf:after { content:''; display:table; clear:both; } 32 33 /* Style */ 34 .category { width:100%; margin:0 0 20px 0; padding:10px 20px; border-top:3px #333 solid; border-bottom:1px #333 solid; } 35 .category dt { float:left; font-size:2.0rem; } 36 .category dd { float:right; } 37 </style> 38 39</head> 40<body> 41 42 43 44<dl class="category cf"> 45 <dt>タイトル</dt> 46 <dd>テキストテキストテキストテキストテキストテキスト</dd> 47</dl> 48 49 50 51</body> 52</html>

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。