我的 laravel 應用程序中有一個按鈕<a href="{{ url('/product') }}" class="btn btn-default px-5 mt-3 rounded subscribe" role="button">{{ __('More info') }}</a>所以我需要按鈕文本位于按鈕的中心。但目前文本并未正確居中于按鈕目前按鈕看起來像這樣。文本沒有很好地居中。在我的 css 中,我有以下類代碼,訂閱.subscribe { background-color: #5ABDBA; color: #fff; border-radius: 40px!important; height: 43px; text-transform: capitalize!important; vertical-align: middle; }我正在使用 bootstrap 4 。
2 回答

瀟瀟雨雨
TA貢獻1833條經驗 獲得超4個贊
為什么要強制按鈕高度?
并始終青睞框架現有類
.subscribe { background-color: #5abdba; }
<a href="/" class="btn btn-default px-5 mt-3 rounded-pill text-white text-capitalize subscribe" role="button">{{ __('More info') }}</a>
- 2 回答
- 0 關注
- 143 瀏覽
添加回答
舉報
0/150
提交
取消