我已经更新到bootstrap 3.之前我有一个div是一个圆圈,在那个圆圈里面有一个图标,它是从一个字形图标中取出来的。这是一个完美的圆圈,现在圆圈更像是一个圆形的矩形。如果我在圆圈中没有图标,它将是一个圆圈,但只要我将一个图标放入圆圈就会变成一个矩形。先前版本的bootstrap没有发生这种情况。 jsfiddle有我目前的代码。小提琴将显示一个圆圈,因为我无法在小提琴中添加一个字形图标(复选标记),但如果它在那里(列表标签上的类,fa-icon-check,是什么获得的)图标)它将是一个圆形矩形而不是圆形。当图标在里面时,如何让圆圈保持圆圈?
CSS:
private mockLabels: Array<Label> = [
new Label(1, 'hotel'),
new Label(2, 'sport'),
new Label(3, 'gaming'),
new Label(4, 'apple'),
new Label(5, 'retail')
];
public getLabels() {
return this.mockLabels;
console.log(this.mockLabels);
}
HTML:
.icons-box {
text-align: center;
padding: 20px 10px 10px 10px;
}
.icons-box i {
font-size: 44px;
display: inline-block;
-webkit-border-radius: 50em;
-moz-border-radius: 50em;
border-radius: 50em;
background: #fff;
padding: 45px 42px;
答案 0 :(得分:0)
以下是Circle中的一些Boot strap字形图标: -
<style>
.btn-round {
width: 40px;
height: 40px;
border-radius: 50%;
}
.btn-round.btn-lg {
width: 48px;
height: 48px;
}
.btn-round.btn-sm {
width: 34px;
height: 34px;
}
.btn-round.btn-xs {
width: 24px;
height: 24px;
}
</style>
<!-- large buttons -->
<button type="button" class="btn btn-default btn-lg btn-round"><span class="glyphicon glyphicon-retweet"></span></button>
<button type="button" class="btn btn-primary btn-lg btn-round"><span class="glyphicon glyphicon-share"></span></button>
<button type="button" class="btn btn-success btn-lg btn-round"><span class="glyphicon glyphicon-thumbs-up"></span></button>
<button type="button" class="btn btn-danger btn-lg btn-round"><span class="glyphicon glyphicon-thumbs-down"></span></button>
<button type="button" class="btn btn-info btn-lg btn-round"><span class="glyphicon glyphicon-zoom-in"></span></button>
<button type="button" class="btn btn-warning btn-lg btn-round"><span class="glyphicon glyphicon-zoom-out"></span></button>
<!-- default size buttons -->
<button type="button" class="btn btn-default btn-round"><span class="glyphicon glyphicon-music"></span></button>
<button type="button" class="btn btn-primary btn-round"><span class="glyphicon glyphicon-fast-backward"></span></button>
<button type="button" class="btn btn-success btn-round"><span class="glyphicon glyphicon-play"></span></button>
<button type="button" class="btn btn-info btn-round"><span class="glyphicon glyphicon-stop"></span></button>
<button type="button" class="btn btn-warning btn-round"><span class="glyphicon glyphicon-fast-forward"></span></button>
<button type="button" class="btn btn-danger btn-round"><span class="glyphicon glyphicon-volume-off"></span></button>
<!-- small buttons -->
<button type="button" class="btn btn-default btn-sm btn-round"><span class="glyphicon glyphicon-paperclip"></span></button>
<button type="button" class="btn btn-primary btn-sm btn-round"><span class="glyphicon glyphicon-align-left"></span></button>
<button type="button" class="btn btn-success btn-sm btn-round"><span class="glyphicon glyphicon-align-center"></span></button>
<button type="button" class="btn btn-info btn-sm btn-round"><span class="glyphicon glyphicon-align-right"></span></button>
<button type="button" class="btn btn-warning btn-sm btn-round"><span class="glyphicon glyphicon-align-justify"></span></button>
<button type="button" class="btn btn-danger btn-sm btn-round"><span class="glyphicon glyphicon-trash"></span></button>
<!-- extra small buttons -->
<button type="button" class="btn btn-default btn-xs btn-round"><span class="glyphicon glyphicon-user"></span></button>
<button type="button" class="btn btn-primary btn-xs btn-round"><span class="glyphicon glyphicon-stats"></span></button>
<button type="button" class="btn btn-success btn-xs btn-round"><span class="glyphicon glyphicon-ok"></span></button>
<button type="button" class="btn btn-info btn-xs btn-round"><span class="glyphicon glyphicon-comment"></span></button>
<button type="button" class="btn btn-warning btn-xs btn-round"><span class="glyphicon glyphicon-envelope"></span></button>
<button type="button" class="btn btn-danger btn-xs btn-round"><span class="glyphicon glyphicon-remove"></span></button>