【发布时间】:2015-11-05 06:29:27
【问题描述】:
我有以下 sn-p 来渲染一个与另一个重叠的图标。整个 div 是一个链接。目前我正在使用 position:absolute 并调整重叠。没有绝对位置怎么办。我还希望整个 div 位于屏幕右侧(目前位于左侧)。
.btn-circle {
position: absolute;
top: 4px;
left: 25px;
width: 30px;
height: 30px;
line-height: 30px;
background: red;
border-radius: 50%;l
}
.count {
position: absolute;
top:8px;
left:38px;
font-size:16px;
font-weight: bold;
color:white;
}
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<div class="">
<a href="#">
<i class="fa fa-inbox fa-2x"></i>
<span id="red-circle" class="btn btn-circle"></span>
<span id="toDosCount" class="count">9</span>
</a>
</div>
【问题讨论】:
-
为什么不想使用绝对定位?
-
我选择红蜘蛛,虽然他是霸天虎,
position: absolute没问题
标签: css html font-awesome-4