html - 为什么按钮的文字没有居中对齐?

标签 html css

这是 html:

<button class="btncicle" >+</button>

CSS:

.btncicle {
    border-radius: 50%;
    width:15px;
    height:15px;
    padding: 0px;
    text-align:center; 
    vertical-align:middle;
    line-height: 15px;
}

我已经使用了 vertical-align 或 line-height ,但是按钮的文本仍然没有居中对齐。

Demo

为什么按钮的文字没有居中对齐?

最佳答案

试试这个: 更改行高属性。

行高:50%;

关于html - 为什么按钮的文字没有居中对齐?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51317579/

相关文章:

html - 移动菜单 Bootstrap 中的 Logo

html - 如何将 rgba(82, 168, 236, 0.8) 转换为普通的 #000000 类型颜色?

PHP strip 标签不工作

javascript - 多个粘性标题和侧边栏

css - 如何创建一个使用 BootStrap 的 WordPress 主题?

php - 博客的 PicoCMS 分页

python - scrapy 无法提交表单

javascript - iframe 加载事件

javascript - 当我输入更多文本时,如何让工具提示背景扩展或增长?

html - 减少文本和边框之间的空间?