我有一个在表单中使用的提交按钮。长文本通常没问题,但在小屏幕上查看时会出现问题。
当前,无论页面宽度如何,按钮都保持相同的宽度,如果页面太窄,则会导致页面水平滚动。
我希望文本像在 inline-block 元素中一样环绕。我已经在 css 中指定了它,但它似乎不起作用。
input{background:#deaded;padding:10px 30px;display:inline-block;border-radius:5px}
<input type="submit" value="This is where the slogan goes" />
您可以使用white-space: normal;
.
input {
background: #deaded;
padding: 10px 30px;
display: inline-block;
border-radius: 5px;
white-space: normal;
}
<input type="submit" value="This is where the slogan goes" />
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句