HTML中心图像和文本DIV中
<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
元素上设置固定宽度。有人可以帮我解决这个问题吗?
注:对不起,如果我不清楚。我想要文本左侧的评论泡泡,然后我希望评论泡泡和文本集中在黑框内。
我总是接受的答案。只是在我问过的几个问题上,我没有得到任何答案。为什么downvote? – J82