我正在处理我的页面并遇到问题。尝试将(年份或待定)对齐到列的右侧。例如,见图像。
顶部是现在的样子。底部图像是我想要的样子。
答案 0 :(得分:7)
尝试使用span然后将样式设置为等于'float:right'
<span style="float:right">pending </span>
答案 1 :(得分:3)
<强> Demo 强>
CSS
ul {
list-style: none;
}
#about ul li span {
float: right;
}
HTML
<div id="about">
<h3><strong>Education</strong></h3>
<ul>
<li><strong>Golden West College – Huntington Beach, CA <span>2012-2014</span></strong>
</li>
<li>– Associate in Arts Degree – Digital Arts Major <span>(pending)</span>
</li><br/>
<li>Certificate of Achievement</li>
<li>– Graphic Design and Production Option <span>(pending)</span>
</li><br/>
<li>Certificate of Specialization</li>
<li>– Graphic Design Foundation <span>6/2014</span>
</li>
<li>– Graphic Design Advanced Production <span>(pending)</span>
</li>
</ul>
</div>
答案 2 :(得分:-1)
你去吧
<ul>
<strong>Golden West College – Huntington Beach, CA <span style="float:right">2012-2014</span></strong><br>
– Associate in Arts Degree – Digital Arts Major <span style="float:right">(pending)</span><br>
<br> Certificate of Achievement<br>
– Graphic Design and Production Option <span style="float:right">(pending)</span><br>
<br> Certificate of Specialization<br>
– Graphic Design Foundation <span style="float:right">6/2014</span><br>
– Graphic Design Advanced Production <span style="float:right">(pending)</span><br>
</ul>
这是一个JSFiddle Click here