如果按钮元素的宽度不足以包含按钮文本,Firefox 和 Chrome 会给按钮更高的高度,IE(至少 v7)将被截断。如何让 IE 扩展高度以包含文本?理想情况下只使用 CSS。
我尝试明确给 IE7 指定一个高度,使按钮变大,但它仍然只显示一行被剪切的文本。
<button style="width:40px;">Some really long text that is more than 20px</button>
在真实版本中,我使用的是 ButtonGroup YUI 控件,因此无法使用 <input>
元素。
最佳答案
我没有安装 IE7,但在 IE6 中可以在按钮内添加 DIV
:
<button style="width:40px;"><div style="height: 100%">Some really long text that is more than 20px</div></button>
关于html - HTML 中的多行按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3485195/