开发者

How do I change the background color of an apDiv?

开发者 https://www.devze.com 2023-03-02 02:59 出处:网络
How do I change the background color of an apDiv? I tried using background-color: eeeeee; and it looks fine in dreamweaver but in chrome and firefox the color remains white.

How do I change the background color of an apDiv? I tried using background-color: eeeeee; and it looks fine in dreamweaver but in chrome and firefox the color remains white.

开发者_如何学Python

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

Kind regards

Pongy


The correct CSS would be

background-color: #eeeeee;

Some browsers may forgive the omission of the #, others will not.


You need to use background-color: #eeeeee; instead of 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.

Modern browsers don't forgive the omission of the #, unless they are in Quirks Mode (=bad):

The CSS parser accepts colors not beginning with #.

0

精彩评论

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