简体   繁体   English

如何更改 apDiv 的背景颜色?

[英]How do I change the background color of an apDiv?

How do I change the background color of an apDiv?如何更改 apDiv 的背景颜色? I tried using background-color: eeeeee;我尝试使用背景颜色:eeeeee; and it looks fine in dreamweaver but in chrome and firefox the color remains white.它在 Dreamweaver 中看起来不错,但在 chrome 和 firefox 中,颜色仍然是白色。

http://www.sandboxes.tk/sandboxes/testproject.php http://www.sandboxes.tk/sandboxes/testproject.php

Kind regards亲切的问候

Pongy庞吉

The correct CSS would be正确的 CSS 将是

background-color: #eeeeee;

Some browsers may forgive the omission of the #, others will not.一些浏览器可能会原谅 # 的省略,而其他浏览器则不会。

You need to use background-color: #eeeeee;您需要使用background-color: #eeeeee; instead of background-color: eeeeee;而不是background-color: eeeeee; . .

Maybe linking to this is a little overboard, but from the spec :也许链接到这个有点过分,但从规范

The format of an RGB value in hexadecimal notation is a '#' immediately followed by either three or six hexadecimal characters.十六进制表示法的 RGB 值的格式是一个“#”,后跟三个或六个十六进制字符。

Modern browsers don't forgive the omission of the # , unless they are in Quirks Mode ( =bad ):现代浏览器不会原谅省略#除非它们处于Quirks 模式=bad ):

The CSS parser accepts colors not beginning with #. CSS 解析器接受不以 # 开头的 colors。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM