A colour is a either a colour name or a numerical RGB specification. The Style Sheet specification (and style sheets as implemented by Microsoft in the Internet Explorer) supports all of the Netscape colour names.
The following all specify a red colour
EM { color: #F00 } | #RGB |
EM { color: #FF0000 } | #RRGGBB |
EM { color: rgb(255,0,0) | integer range 0 - 255 |
EM { color: rgb(100%, 0%, 0%) | float range 0.0% - 100.0% |
Note that a 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.
Values outside the numerical ranges will be rounded off. The three rules below are therefore equivalent:
EM { color: rgb(255,0,0) | integer range 0 - 255 |
EM { color: rgb(300,0,0) | rounded off to 255 |
EM { color: rgb(110%, 0%, 0%) | rounded off to 100% |
© 1995-1998, Stephen Le Hunte
file: /Techref/language/html/ib/Style_Sheets/colunit.htm, 2KB, , updated: 2004/3/1 15:47, local time: 2024/12/4 16:13,
3.15.2.68:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://massmind.org/Techref/language/html/ib/Style_Sheets/colunit.htm"> Colour units</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to massmind.org! |
.