【发布时间】:2014-05-15 02:09:01
【问题描述】:
我们可以在 CSS3 中将 -moz-max-content(对于 Firefox)和 -webkit-max-content(对于 Chrome、Safari)设置为 width,但似乎 -ms-max-content 在 Internet Explorer (IE11) 中不起作用。
更新:这是一个示例代码:
.button {
background: #d1d1d1;
margin: 2px;
cursor: pointer;
width: -moz-max-content;
width: -webkit-max-content;
width: -o-max-content;
width: -ms-max-content;
}
<div>
<div class="button"> Short t. </div>
<div class="button"> Looooooong text </div>
<div class="button"> Medium text </div>
</div>
【问题讨论】:
-
也许一些代码会很好,这样人们可以帮助你。
-
问题已更新为代码示例。谢谢。
标签: html css internet-explorer internet-explorer-11