Which color is #0000?

I'm trying to guess which color is #0000

In the following code:

$('.example').css({"background-color":"#0000","opacity": "0.20", "filter": "alpha(opacity=20)" });

Replacing #0000 by any of the following colors don't produce the same effect:

#0000FF, #FF0000, #00FF00, #000000, #00000, #000

I thought any 3 o 4 digit color had a corresponding 6 digit color. I'm I wrong?

Answers


From http://dev.w3.org/csswg/css-color/#hex-notation:

4 digits

This is a shorter variant of the 8-digit notation, "expanded" in the same way as the 3-digit notation is. The first digit, interpreted as a hexadecimal number, specifies the red channel of the color, where 0 represents the minimum value and f represents the maximum. The next three digits represent the green, blue, and alpha channels, respectively.

transparent, like rgba(0, 0, 0, 0.0)

not supported yet tho. From http://www.w3.org/TR/CSS2/syndata.html#parsing-errors:

Illegal values. User agents must ignore a declaration with an illegal value.

Here's a testcase. Yellow background = not supported. Transparent (white) background = supported.

http://jsfiddle.net/p5aJJ/

<div class="test">hello</div>

...

div {
    background-color: yellow;
}

div.test {
    background-color: #0000;
}

Need Your Help

select top n record from each group sqlite

sql sqlite greatest-n-per-group

I am trying to select top 2 records from a database table result that looks like this

How do you translate (char)B00000001 (c++) to the python equivalent?

python c++ raspberry-pi

I am currently trying to translate a C++ library to python script, that essentially controls a quadrature decoder (LS7366R). The python script will run on a raspberry pi using the spidev library to

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.