css - label文字居中
伊谢尔伦
伊谢尔伦 2017-04-17 11:57:23
0
6
859

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

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(6)
刘奇

Why the botton tag? Isn’t it a button

Ty80

Centered left and right: text-align:center;
Centered top and bottom: line-height:2rem;

黄舟

For interline elements, you need to write inline-block

In fact, it is recommended that you pad left and right

迷茫

text-align:center;display:inline-block;

Ty80

The inline block you use will adapt to the content, and there is no way to control the position of the content inside the block

黄舟

What is label? Please pay attention to label semantics

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template