IE8中的CSS Max-Width

Kev*_*ith 14 html css firefox internet-explorer-8

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

input.half, input.half.not-placeholder-value {
    max-width: 25em;
}
Run Code Online (Sandbox Code Playgroud)

然而,根据开发者工具,IE8似乎没有使用这个特定的max-width属性.我说"似乎没有使用",因为Firefox的行为与IE8在这个属性方面有所不同.

但是MDN 文档说IE7支持max-width.我错过了什么吗?

Rap*_*nah 24

这不是IE8的问题,因为IE8 确实支持max-width属性,但只有在首先给定定义的宽度时才支持.

input.half, input.half.not-placeholder-value {
    width: 100%;
    max-width: 25em;
}
Run Code Online (Sandbox Code Playgroud)