这是我的代码的小提琴:http: //jsfiddle.net/ZWQpb/
这是HTML:
<div class="blog-entry">
<ol>
<li><h4 class="title"><a href="">10 moments in cinematic history changing thus</a></h4></li>
<li><h4 class="title"><a href="">Testing this theme with image</a></h4></li>
<li><h4 class="title"><a href="">More experimental things and more</a></h4></li>
<li><h4 class="title"><a href="">The video that defined a new definition</a></h4></li>
</ol>
</div>
和CSS:
body {
padding: 50px;
}
.blog-entry {
padding-left: 32px;
position: relative;
width: 248px;
}
.blog-entry ol {
color: #999999;
font: italic 3em Arial,sans-serif;
list-style-type: decimal;
}
.blog-entry h4.title {
color: #48423F;
font-family: Arial,sans-serif;
font-size: 16px;
padding-left: 25px;
padding-right: 33px;
text-shadow: none;
}
我希望每个列表项从数字的顶部对齐。以这张图片为例:
我怎样才能做到这一点?随时更新小提琴:http: //jsfiddle.net/ZWQpb/