![](/img/trans.png)
[英]react-bootstrap-table: cannot set a glyphicon on a custom toolbar button
[英]react react-bootstrap button cannot set custom height. only can set width with css
我一直被困在這個問題上,還沒有找到一種方法來調整帶有 css 樣式的 react-bootstrap 按鈕的高度。 我可以設置寬度。 這是我的以下代碼
JSX
在渲染和返回代碼中
<div className="row">
<Button className="btn-danger btn-edit btn btn-default">Button 1</Button>
<Button className="btn-danger btn-edit btn btn-default">Button 2</Button>
<Button className="btn-info btn-edit btn btn-default">Button 3</Button>
<Button className="btn-success btn-edit btn btn-default">Button 4</Button>
<Button className="btn-primary btn-edit btn btn-default">Button 5</Button>
</div>
in my style code, I added a class for each to add custom height and weight
.btn-danger {
width: 25% !important
height: 20% !important
}
.btn-success {
width: 25% !important
height: 20% !important
}
.btn-primary {
width: 25% !important
height: 20% !important
}
.btn-info {
width: 25% !important
height: 20% !important
}
.btn-success {
width: 25% !important
height: 20% !important
}
我按 F12 檢查按鈕並添加/調整 btn、btn-danger 等的高度......高度根本沒有改變。
在嘗試這些步驟時,我不知道下一步要嘗試什么。 我認為如果自定義類允許我更改寬度,它也會讓我更改高度。
任何幫助表示贊賞,謝謝
找到了解決方案。 在 css 中將高度更改為 min-height。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.