0
style {
background-color: rgb(224,224,195);
}

Should be the same as:

style {
background-color: #f4e0c3;
}

According to Photoshop which I checked a few times:

enter image description here

But when I use the RGB value in my CSS I'm getting this:

enter image description here

If I use the Hex value, I get the color that I was expecting:

enter image description here

Any idea what the difference is so I can be aware of it in the future? I've never had, or at least never noticed, any problems with RGB() before.

  • 1
    I'm voting to close this question as off-topic because it is a typo and not helpful to future readers – Zach Saucier Jun 22 '17 at 20:08
  • 1
    @ZachSaucier so questions about code that is not working isn't allowed?? – DᴀʀᴛʜVᴀᴅᴇʀ Jun 22 '17 at 21:09
  • For questions dealing with typographic errors, I think they shouldn't be allowed. As stated, I don't think this will be helpful to anyone who comes across it in the future. There's even a close reason on StackOverflow for this specific reason – Zach Saucier Jun 23 '17 at 13:03
  • It has nothing to do with it being code or not (other than the fact that it is typed and prone to typos) @DᴀʀᴛʜVᴀᴅᴇʀ – Zach Saucier Jun 23 '17 at 13:13
3

UPDATE: There IS a typo in your code :))

You wrote rgb(224,224,195); instead of rgb(244,224,195);


Are you sure there isn't any kind of typo in your code? Cause I could not replicate your issue:

enter image description here

Here, try my code and see if this comes up the same way:

.hex,
.rgb{
    width:300px;
    height:300px;
    position:relative;
    margin:0 auto;
    background:#f4e0c3;
}
.rgb{
    background:rgb(244, 224, 195);
}

<div class="hex">
</div>
<div class="rgb">
</div>

Anyway, whatever it is, since I could not replicate it, it must be local. Maybe browser related?

| improve this answer | |
  • 1
    Hah not only was there a typo but I made the same typo writing the question --- 224, 224 shouldve been 244, 224 . Thanks, im gonna go have another coffee now – Ryan Jun 22 '17 at 18:46
  • Cheers @Ryan, enjoy the coffee ! :D – Alin Jun 22 '17 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.