【发布时间】:2014-12-07 23:59:50
【问题描述】:
真的很简单的问题。我有一些使用边框图像的按钮。他们使用的图像有很大的圆角,所以内容所在的内框总是被大量的边框填充。 我想让按钮适应文本的宽度,但让文本直接到边缘。 基本上需要消除文本边缘和边框边缘之间的大间隙。
以下是我已有的以及我想要更改的示例:
.a {
display: inline-block;
border-style: solid;
border-width: 30px 30px;
border-image: url(http://qt-project.org/doc/qt-4.8/images/qml-borderimage-tiled.png) 30 30 fill round;
box-sizing: border-box;
}
<div class="a">
TEXT TEXT TEXT
</div>
因此,即使在该示例中看起来很糟糕,我也希望文本边缘接触边框图像边缘。 我试过'box-sizing:border-box;'但这似乎只适用于普通边框。
【问题讨论】:
-
使用没有模糊的 Box-shadow...