Does style="color: #FFF;" render as #F0F0F0 or #FFFFFF?
Posted
by Dolph Mathews
on Stack Overflow
See other posts from Stack Overflow
or by Dolph Mathews
Published on 2010-05-24T18:15:51Z
Indexed on
2010/05/24
18:21 UTC
Read the original article
Hit count: 271
When defining colors using "shorthand hexidecimal" (style="color: #FFF;"
), is there a defined method for expanding the shorthand? (style="color: #F0F0F0;"
or style="color: #FFFFFF;"
)
Do all browsers use the same expansion method? Is this behavior by specification (if so, where is it defined)? Does the expansion method perhaps vary between CSS 1/2/3?
I've observed that "most browsers" expand to #FFFFFF
.
Are there any other places where this shorthand notation is allowed, but the expansion method is different?
I've always avoided using shorthand hex, because I've never known the answers to these questions...
© Stack Overflow or respective owner