CSS最大宽度在IE8 [英] CSS Max-Width in IE8

查看:226
本文介绍了CSS最大宽度在IE8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的输入,可以有 classname =halfhalf.not-placeholder-value,Firebug显示两个输入有一组,固定宽度 25em

For my input, which can either have classname="half" or "half.not-placeholder-value", Firebug shows both inputs to have a set, fixed width of 25em.

input.half, input.half.not-placeholder-value {
    max-width: 25em;
}

然而,根据开发人员工具,IE8似乎没有使用这个特殊的 max-width 属性。我说似乎不使用,因为Firefox的行为不同于IE8相对于这个属性。

Yet, according to Developer Tools, IE8 doesn't seem to use this particular max-width attribute. I say "doesn't seem to use" since Firefox's behavior differs with IE8 with respect to this attribute.

但MDN docs 说IE7支持 max-width

But the MDN docs say that IE7 supports max-width. Am I missing something?

推荐答案

这不是IE8的问题,因为IE8 支持max -width属性,但仅在首先给定定义的宽度时。

This is not really an IE8 issue since IE8 does support the max-width attribute but only when given a defined width first.

input.half, input.half.not-placeholder-value {
    width: 100%;
    max-width: 25em;
}

这篇关于CSS最大宽度在IE8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆