简体   繁体   中英

How do I change the background color of an apDiv?

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.

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 #.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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