Should you use the # in the css to describe colors of not?
ffffff or #ffffff
| SitePoint Sponsor |



Should you use the # in the css to describe colors of not?
ffffff or #ffffff
I don't believe you have to, but it's a good idea to get into the habit. I know you have to in XML and XHTML and that will be fast beocming the standards. Use it to be safe.
Sketch





Yes, you need it to indicate the format is hexadecimal
Code:<style> BODY {color:#eaeaea} </style>





There are other possibilities, for example
Code:BODY { color: #f00 } /* #rgb */ BODY { color: #ff0000 } /* #rrggbb */ BODY { color: rgb(255,0,0) } BODY { color: rgb(100%, 0%, 0%) }
Bookmarks