文章详情页
css - label文字居中
浏览:45日期: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>
没有居中是什么原因,不想通过设置padding
问题解答
回答1:为什么是botton标签?不是button吗
回答2:左右居中:text-align:center;上下居中:line-height:2rem;
回答3:行间元素,你要写inline-block
其实建议你左右padding
回答4:text-align:center;display:inline-block;
回答5:你用的内联块,会自适应内容的,没办法控制内容在块里面的位置
回答6:label是什么,请注意标签语义化
标签:
CSS
相关文章:
排行榜
