html - 为什么我需要设置背景颜色?

标签 html css internet-explorer-8 internet-explorer-7 internet-explorer-9

我对这件事很困惑。我试图让 div 中的文本区域在 IE7、IE8 和 IE9 中工作,但不小心我将样式背景从无更改为颜色。这使它起作用。

谁能解释一下?

对于困惑的设置,我深表歉意。在了解背景问题后,会将所有样式提升到 css 文件。

不起作用

<textarea id="chatWindowMessageArea" style="position: absolute; display: block; margin: 0;
                    padding: 0; border: none; float: none; clear: none; left: 35px; top: 302px; width: 315px;
                    max-width: 315px; min-width: 315px; height: 63px; max-height: 63px; min-height: 63px;
                    z-index: 2; background-color: transparent; background: none; font-style: normal;
                    font-weight: normal; font-size: 100%; line-height: normal; text-shadow: none;
                    list-style: none; text-align: left; outline: none; text-indent: 0px; -moz-box-shadow: none;
                    -webkit-box-shadow: none; font-family: arial,sans-serif; font-size: 12px; font-weight: normal;
                    color: black; vertical-align: top; resize: none; overflow: auto;" type="text"
                    name="chat">
                </textarea>

有效!

<textarea id="chatWindowMessageArea" style="position: absolute; display: block; margin: 0;
                    padding: 0; border: none; float: none; clear: none; left: 35px; top: 302px; width: 315px;
                    max-width: 315px; min-width: 315px; height: 63px; max-height: 63px; min-height: 63px;
                    z-index: 2; background-color: transparent; background: #FFFFFF; font-style: normal;
                    font-weight: normal; font-size: 100%; line-height: normal; text-shadow: none;
                    list-style: none; text-align: left; outline: none; text-indent: 0px; -moz-box-shadow: none;
                    -webkit-box-shadow: none; font-family: arial,sans-serif; font-size: 12px; font-weight: normal;
                    color: black; vertical-align: top; resize: none; overflow: auto;" type="text"
                    name="chat">
                </textarea>

最佳答案

background: none 表示您的背景将完全透明。

因此,没有任何东西可以点击;您实际上是在点击隐藏框后面的任何内容。

关于html - 为什么我需要设置背景颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23496891/

相关文章:

javascript - 以模式形式处理服务器端验证的最佳实践

javascript - 为什么 .click() 不给我的变量赋值?

javascript - Bootstrap 3 在 IE8 中不工作(检查其他答案)

html - 在 CSS 中使用 &lt;script&gt;

javascript - 在提交表单 html5 之前调整图像大小

javascript - 如何在工具提示 Highcharts 中获取多个系列数据(不丢失工具提示指针箭头)

jquery - 加载页面后在基础交换中添加新规则

css - 过滤器 : gradient and background: fixed

jquery fadein 无法在 IE8 上运行

javascript - ng-绑定(bind)数据没有选择第二个选择