开发者

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

开发者 https://www.devze.com 2023-03-31 20:18 出处:网络
Consider the following example: (Live demo here) HTML:开发者_StackOverflow中文版 <div id=\"wrapper\">

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

精彩评论

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