HTML
<div class="leave-comment">
<a href="example-video-8/" rel="bookmark" title="Leave a comment for Example Video 8"><span class="comment-bubble"></span>Leave a comment for Example Video 8!</a>
</div>
CSS
.leave-comment {
background: #010101;
clear: both;
font-size: 1.4em;
padding: 20px 0;
}
.comment-bubble {
background: url(http://i.imgur.com/iqOtL.png) no-repeat left center;
display: inline-block;
height: 24px;
width: 26px;
float: left;
margin-right: 10px;
}
这是 JS 小提琴:http: //jsfiddle.net/CeZLy/
我试图将评论气泡和文本都集中在黑框内。文本将始终在变化,因此我无法在a
元素上设置固定宽度。有人可以帮我解决这个问题吗?
注意:对不起,如果我不清楚。我想要文本左侧的评论气泡,然后我想要评论气泡和文本在黑框内居中。