开发者

How to inherit the background color of textarea from parent element in Internet Explorer?

Consider the following example: (Live demo here)

HTML:开发者_StackOverflow中文版

<div id="wrapper">
    <textarea></textarea>
</div>

CSS:

div {
    background-color: #777;
}
textarea {
    background-color: inherit;
}

I would like the textarea to inherit the background color from the wrapper.

It works well in Firefox.

But, in Internet Explorer 7, the background color is white. Why ?

How could I fix that ?


IE7 does not support inherit for any properties besides direction and visibility.

Source.

You could set the textarea's background-color to transparent instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜