我有一个带有长文本的按钮,例如“单击此处开始播放”。我想控制宽度并以多行显示文本。在 html/css 中可以吗?
最佳答案
是的,您可以使用 white-space css 属性将它放在多行上:)
input[type="submit"] {
white-space: normal;
width: 100px;
}
<input type="submit" value="Some long text that won't fit." />
将此添加到您的元素
white-space: normal;
width: 100px;
关于HTML:我可以多行显示按钮文本吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7469088/