我想创建一个这样的图标:
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
&#13;
如何围绕此图标绘制正方形?感谢。
更新:似乎添加CSS我的代码坏了。
你可以看到它:
一切都不正确。
更新的代码:
span.glyphicon {
background-color: #eee;
border: 1px solid #000;
border-radius: 8px;
height: 50px !important;
padding-top: 17px;
text-align: center;
width: 50px !important;
}
&#13;
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-primary">
<div class="panel-heading active" role="tab" id="headingOne">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseThree">
Example <span class="glyphicon glyphicon-plus pull-right" aria-hidden="true"></span>
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne" aria-expanded="true">
<div class="panel-body">
<div class="list-group">
<form accept-charset="UTF-8" action="" method="post">
<select name="select_baogia" class="select_baogia">
<option value="">Tree 1</option>
<option value="">Tree 2</option>
option
</select>
<input name="name" placeholder="Name" type="text">
<input name="email" placeholder="Email" type="text">
<input class="text_baogia" name="phone" placeholder="Phone num" type="text">
<input name="diadiem" placeholder="Location" type="text">
<button class="btn btn-warning" type="submit">Call back to me</button>
</form>
</div>
</div>
</div>
</div>
&#13;
答案 0 :(得分:3)
span.glyphicon.glyphicon-plus {
background-color: #eee;
border: 1px solid #000;
border-radius: 8px;
height: 50px !important;
padding-top: 17px;
text-align: center;
width: 50px !important;
}
&#13;
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
&#13;
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<a class="btn btn-default" href="#" role="button"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></a> or
<button class="btn btn-default" type="submit"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>
&#13;
查看文档:{{3}}
<强>更新强>
span.glyphicon.glyphicon-plus {
background-color: #eee;
border: 1px solid #888;
border-radius: 8px;
height: 30px !important;
margin-top: -8px;
padding-top: 6px;
text-align: center;
width: 30px !important;
}
&#13;
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-primary">
<div class="panel-heading active" role="tab" id="headingOne">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseThree">
Example <span class="glyphicon glyphicon-plus pull-right" aria-hidden="true"></span>
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne" aria-expanded="true">
<div class="panel-body">
<div class="list-group">
<form accept-charset="UTF-8" action="" method="post">
<select name="select_baogia" class="select_baogia">
<option value="">Tree 1</option>
<option value="">Tree 2</option>
</select>
<input name="name" placeholder="Name" type="text">
<input name="email" placeholder="Email" type="text">
<input class="text_baogia" name="phone" placeholder="Phone num" type="text">
<input name="diadiem" placeholder="Location" type="text">
<button class="btn btn-warning" type="submit">Call back to me</button>
</form>
</div>
</div>
</div>
</div>
&#13;
注意: CSS是一种非常简单的语言。您可以通过w3school学习:http://getbootstrap.com/css/#buttons
答案 1 :(得分:1)
你可以把它放在CSS中,这可以回答你的问题。
.glyphicon{
border:1px solid #000;
padding: 5px 10px;
}
修改强>
这是一个有效的小提琴