我正在尝试我的按钮样式,但当我试图通过高度或宽度属性来调整它的大小时,它会一直剪切里面的文本。我也试过用垫子,但运气不好。
这是一些我的问题图片
我希望蓝色区域的高度更小,并且“x”在正方形内居中。
上面的css代码是

.delete {
 cursor: pointer !important;
 font-size: 42px;
 position: absolute;
 color: gray;
 height: 50px;
}

这个的css代码是
.delete {
 cursor: pointer !important;
 font-size: 42px;
 position: absolute;
 color: gray;
 height: 30px;
}

如何设置按钮的样式以使其按我所需的方式向上移动“x”文本?
这是我的html
<button type="button" class="delete" ng-click="deleteModel(model)">
      <span>&times;</span>
      <span class="sr-only">Delete</span>
</button>

最佳答案

尝试使用line-height

line-height:25px;

你可能需要利用价值观。25px的代码看起来不错。
http://jsfiddle.net/686s8/

关于html - 如何在不剪切文本的情况下调整按钮的大小,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/25125050/

10-12 00:14
查看更多