What is the equivalent Hex ?

R

Reshma

Hello:

I am new to HTML and CSS. I came across this block of code, .link{
color:#269;
display:block;
margin:4px 0 0 0;
padding:2px 1em;
}

I am wondering what is the equivalent hex code for the color:#269 in
the above.

Thanks
 
H

Harlan Messinger

Reshma said:
Hello:

I am new to HTML and CSS. I came across this block of code, .link{
color:#269;
display:block;
margin:4px 0 0 0;
padding:2px 1em;
}

I am wondering what is the equivalent hex code for the color:#269 in
the above.

A three-digit RGB code #xyz is shorthand for a six-digit hex code
#xxyyzz. So, #226699.
 
A

Animesh K

Harlan said:
A three-digit RGB code #xyz is shorthand for a six-digit hex code
#xxyyzz. So, #226699.

Correct. Also, you can use common colors by name (typically helps in
visualizing better).

For example:

"color: black;" or "color: white;" are valid CSS properties. Modern
browsers support more such named-colors than what is officially endorsed
by W3C.

http://www.w3.org/TR/CSS21/syndata.html#color-units

Have fun,
Animesh
 
B

Blinky the Shark

Harlan said:
A three-digit RGB code #xyz is shorthand for a six-digit hex code
#xxyyzz. So, #226699.

I did not know that; I always use six-digit. How is browser support?
 
A

Animesh K

Blinky said:
I did not know that; I always use six-digit. How is browser support?

Since this method is used at CSS Zen garden too, I think it will have a
good cross-browser support. Dave and Molly typically test Zen garden
designs on various browsers before publishing (or so they claim).
 
B

Bone Ur

Well bust mah britches and call me cheeky, on Thu, 01 Nov 2007 21:55:30 GMT
Blinky the Shark scribed:
I did not know that; I always use six-digit. How is browser support?

....To save 3 lousy alphanumeric digits per attribute?

(I've had no trouble with any browser the few times I've done it.)
 
D

Dylan Parry

Animesh said:
Dave and Molly typically test Zen garden designs on various browsers
before publishing (or so they claim).

When you say Molly, I presume Holzschlag; but I'm not sure about Dave...
the only one that springs to mind is Raggett. So put me out of my
misery; Who is Dave?

It's probably obvious that I never look at the Zen Garden ;)

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

The opinions stated above are not necessarily representative of
those of my cats. All opinions expressed are entirely your own.
 
E

Els

Dylan said:
When you say Molly, I presume Holzschlag; but I'm not sure about Dave...
the only one that springs to mind is Raggett. So put me out of my
misery; Who is Dave?

This is Dave:
http://www.mezzoblue.com/

(I didn't even know Molly helps him with CSS Zen Garden said:
It's probably obvious that I never look at the Zen Garden ;)

Or subscribe to Dave's blog ;-)
 
B

Blinky the Shark

Bone said:
Well bust mah britches and call me cheeky, on Thu, 01 Nov 2007 21:55:30 GMT
Blinky the Shark scribed:


...To save 3 lousy alphanumeric digits per attribute?

I'll continue using six-digit codes. I just wondered about support.
(I've had no trouble with any browser the few times I've done it.)

To save three lousy characters? ;)
 
S

Sparky

I'll continue using six-digit codes. I just wondered about support.


To save three lousy characters? ;)

if you are on a mac you can get the exact hex code for any color on
your screen
go to Application > utilities > DigitalColor Meter
open it and select 8 bit hex value,
then make sure the reading point is at one pixel and the you can tell
the color of each pixel
 
D

dorayme

3 chars multiplied by many instances adds up.
if you are on a mac you can get the exact hex code for any color on
your screen
go to Application > utilities > DigitalColor Meter
open it and select 8 bit hex value,
then make sure the reading point is at one pixel and the you can tell
the color of each pixel

And you can copy/paste that value, it has quotes around it which
must be removed (a nuisance... but it is better than a poke in
the eye with a burnt stick).
 
B

Bone Ur

Well bust mah britches and call me cheeky, on Fri, 02 Nov 2007 01:16:02
GMT Blinky the Shark scribed:
I'll continue using six-digit codes. I just wondered about support.


To save three lousy characters? ;)

Strictly for experimental purposes or on those occasions when I suffered
from key finger fatigue.
 
D

dorayme

Bone Ur said:
Strictly for experimental purposes or on those occasions when I suffered
from key finger fatigue.

What is the problem with 3 digit specs that you have ever found?
 
B

Blinky the Shark

Bone said:
Well bust mah britches and call me cheeky, on Fri, 02 Nov 2007 01:16:02
GMT Blinky the Shark scribed:


Strictly for experimental purposes or on those occasions when I suffered
from key finger fatigue.

But of course. :)
 
B

Bone Ur

Well bust mah britches and call me cheeky, on Fri, 02 Nov 2007 04:37:53
GMT dorayme scribed:
What is the problem with 3 digit specs that you have ever found?

I don't like them because they promote sloppy coloring. Standard colors
don't have 3 groups of repeated digits; they're more like #808080 or
#c0c0c0 or even #d4d0c8. What color is #aa8844?
 
D

dorayme

Bone Ur said:
Well bust mah britches and call me cheeky, on Fri, 02 Nov 2007 04:37:53
GMT dorayme scribed:


I don't like them because they promote sloppy coloring. Standard colors
don't have 3 groups of repeated digits; they're more like #808080 or
#c0c0c0 or even #d4d0c8. What color is #aa8844?

well, I have not been following closely the context of all this
but if it were to promote such a thing then I am sure it would be
bad and you would be quite right to point this out.

But the real question is: Does it promote sloppy colouring? The
answer to this depends on what the "it" in the last question
refers to: if it refers to a person who mindlessly fixes to use
*only* 3 numbers always, then yes, you are right. But at the cost
of strawmaning your target.

If the "it" refers to someone who sees no point in going #ffffff;
when they can type #fff; but who has and succumbs to frequent
desires to use such as #FFDEAD (NavajoWhite), then your case is
not advanced.

Perhaps the tendency to short form the colours does invite a lazy
tendency in some people? But, you, being aware of the problem
will not succumb. Be a devil and use the short where you can and
not where you want nicer...

There is an argument to say you should use the shorter. It is
this: if you don't you will spend more time typing and reading
longer code and this will sap energy that could be better devoted
to choosing really nice colours when it would be appropriate.

So, in other words, and to sum up, without any empirical evidence
one way or the other, it is as likely that your colour judgements
could be impaired by going one way as it is by going the other
way.
 
J

Jukka K. Korpela

Scripsit Reshma:
I am new to HTML and CSS.

Then read a good book on them, starting from HTML.
I came across this block of code, .link{
color:#269;
display:block;
margin:4px 0 0 0;
padding:2px 1em;
}

Just ignore it.
I am wondering what is the equivalent hex code for the color:#269 in
the above.

What's the point in asking it here? If you tried to learn math, would you
frequent Usenet groups, asking people to tell you how much 16 + 68 is?

The point is that virtually any tutorial on CSS (even the crappy ones) tell
you the various ways to specify colors and how they relate. Did you intend
to manage without reading a single tutorial? Well, then you will probably
copy and imitate crappy code like the one you quoted (apparently setting
some links to a fixed color without setting background).
 
D

Dylan Parry

Els said:

Ah. I know the site said:
Or subscribe to Dave's blog ;-)

Believe it or not, I don't really /do/ blogs. Although I've recently
started listening to Podcasts, so I'm slowly bringing myself into this
millennium ;)

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

The opinions stated above are not necessarily representative of
those of my cats. All opinions expressed are entirely your own.
 
E

Els

Dylan said:
Ah. I know the site, just not the Dave <g>
:)

Believe it or not, I don't really /do/ blogs.

Not even mine? :p
Although I've recently
started listening to Podcasts, so I'm slowly bringing myself into this
millennium ;)

I've listened to a couple of Podcasts, but it's not as good as I
thought it would be. I thought I could just listen to them while doing
other things, but that doesn't work. Apparently multi-tasking is a
chronological concept, not a simultaneous one. I think I still prefer
the pre-podcast method: listen to music while reading content, rather
than listen to content while trying to do something else :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top