Html 如何固定按钮,使其不会因邻近元件的影响而改变其位置?
我有这个密码Html 如何固定按钮,使其不会因邻近元件的影响而改变其位置?,html,css,twitter-bootstrap,Html,Css,Twitter Bootstrap,我有这个密码 <button class='btn btn-danger btn-xs minus'> <span class='glyphicon glyphicon-minus'></span> </button> <span class='quantity bold font20' val='1'>1</span> <button class='btn bt
<button class='btn btn-danger btn-xs minus'>
<span class='glyphicon glyphicon-minus'></span>
</button>
<span class='quantity bold font20' val='1'>1</span>
<button class='btn btn-success btn-xs plus'>
<span class='glyphicon glyphicon-plus'></span>
</button>
这是你的电话号码
您需要浮动:左
每个按钮
和数量
然后给出数量
宽度。如果数字增加并溢出,将显示滚动条
按钮,
.数量{
浮动:左
}
.bold{
字体大小:粗体;
}
font20先生{
字体大小:20px;
}
.数量{
/*使文本水平居中*/
文本对齐:居中;
边框:1px实心#ccc;
/*需要将跨度显示为块*/
显示:块;
宽度:70px;
/*如果溢出显示滚动条,或者您可以更改为溢出-x:隐藏而不显示滚动条*/
溢出-x:自动;
字体大小:粗体;
利润率:0.10px;
}
.clearFloat{
明确:两者皆有;
}
-
99999
+
尝试以下操作:在span标记中添加宽度和高度
.quantity{
显示:内联块;
宽度:50px;
文本对齐:居中;
高度:30px;
背景#f1f1;
垂直对齐:中间对齐;
}
.bold{
字体大小:粗体;
}
font20先生{
字体大小:20px;
}
1.
请共享您的css代码..将宽度添加到QuantityWedth。。没用!因为它是一个跨距,所以在应用Width之前,您需要将其设为内联块(很高兴能帮助您:)
.bold
{
font-weight: bold;
}
.font20
{
font-size: 20px;
}