文章詳情頁
css - label文字居中
瀏覽:264日期:2023-06-26 10:08:37
問題描述
label文字居中
.Botton { background-color: white; margin-left: 0.63rem; border-radius: 0.36rem; font-size: 1.6rem; height:2rem; width:1.5rem; display: -webkit-inline-box; font-weight: 300; text-align:center;}
<label class='Botton'>1</label>

沒有居中是什么原因,不想通過設(shè)置padding
問題解答
回答1:為什么是botton標(biāo)簽?不是button嗎
回答2:左右居中:text-align:center;上下居中:line-height:2rem;
回答3:行間元素,你要寫inline-block
其實(shí)建議你左右padding
回答4:text-align:center;display:inline-block;
回答5:你用的內(nèi)聯(lián)塊,會(huì)自適應(yīng)內(nèi)容的,沒辦法控制內(nèi)容在塊里面的位置
回答6:label是什么,請(qǐng)注意標(biāo)簽語義化
標(biāo)簽:
CSS
相關(guān)文章:
1. javascript - immutable配合react提升性能?2. javascript - sublime快鍵鍵問題3. phpstudy8.1支持win11系統(tǒng)嗎?4. javascript - 移動(dòng)端上不能實(shí)現(xiàn)拖拽布局嗎?5. vue.js - Vue 如何像Angular.js watch 一樣監(jiān)聽數(shù)據(jù)變化6. 實(shí)現(xiàn)bing搜索工具urlAPI提交7. 配置Apache時(shí),添加對(duì)PHP的支持時(shí)語法錯(cuò)誤8. Apache 已經(jīng)把網(wǎng)站根目錄的改為allow from all了,但是服務(wù)器還是不能訪問?9. css - 寫頁面遇到個(gè)布局問題,求大佬們幫解答,在線等,急!~10. javascript - nodejs關(guān)于進(jìn)程間發(fā)送句柄的一點(diǎn)疑問
排行榜

熱門標(biāo)簽
網(wǎng)公網(wǎng)安備