これは以前に尋ねられたことがあると思いますが、検索の言い回しがよくわかりません。
左側に見出し、右側に情報を記載した事実のリストが必要です。これは私がこれまでに持っているものです:
ただし、右側にテキストを入れすぎると、テキストが正しく配置されたままにならず、見出しの下に表示されます。
テキストを右側に揃えるにはどうすればよいですか?これが私が使用しているCSSです:
.about-fact {
border-bottom: 1px dotted #aaa;
padding: 10px 0;
}
.about-headline {
display: inline-block; /* Aligns the content to be the same */
width: 100px;
float:left;
font-weight: bold;
}
.about-value {
}
HTMLの例:
<div class="about-fact">
<div class="about-headline">Profession:</div>
<div class="about-value">Studying Computer Science at Carleton University</div>
</div>
<div class="about-fact">
<div class="about-headline">Experience:</div>
<div class="about-value">Resume</div>
</div>