четверг, 7 февраля 2013 г.

какой цвет fff

examples all specify the same color:

numerical color specifications. These

The RGB color model is used in

I don't see a reason why a browser or the standard wants to deviate from this expansion in the future, since the color #ffffff is far more common than #f0f0f0.

You can check other results in .

On Mac OS X 10.6, all Firefox 3.6, Opera 10.10, Safari 4 rendered #fff as #ffffff.

<div style="background-color:#ffffff;">#ffffff</div>

<div style="background-color:#fff;">#fff</div>

<div style="background-color:#f0f0f0;">#f0f0f0</div>

As a practical example, please check out , which features 3 <div>s of styles

The and docs state the same method.

Wordings of and are the same.

The three-digit RGB notation (#rgb) is converted into six-digit form (#rrggbb) by replicating digits, not by adding zeros. For example, #fb0 expands to #ffbb00. This ensures that white (#ffffff) can be specified with the short notation (#fff) and removes any dependencies on the color depth of the display.

I always kinda assumed it expanded to #ffffff and never really questioned it... good question. –  May 24 '10 at 18:22

I've always avoided using shorthand hex, because I've never known the answers to these questions...

Are there any other places (outside of HTML/CSS) where this shorthand notation is allowed, but the expansion method is different?

I've observed that "most browsers" expand to #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?

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;")

html - Does style="color: #FFF;" render as #F0F0F0 or #FFFFFF? - Stack Overflow

Комментариев нет:

Отправить комментарий