Stop Firefox rendering inline colours in rgb() form

前端 未结 3 784
Happy的楠姐
Happy的楠姐 2021-01-20 15:29

I\'m trying to write a JavaScript tool to work on items of a certain colour. On a test page, I set the colour using an inline style, to mimic the target pages, but when the

相关标签:
3条回答
  • 2021-01-20 16:04

    You are probably looking at the value through firebug, which translates all colors to RGB form in the console. This does not mean it changed in the DOM.

    0 讨论(0)
  • 2021-01-20 16:08

    This is not a conversion, it's just a different way of expressing the same thing. If you want to check for a particular colour, you will have to first express it in rgb format, then do the check. As far as I am aware, the css value returned for a DOM element is whatever it is - you cannot change the format.

    0 讨论(0)
  • 2021-01-20 16:19

    Check out this script to convert rgb() notation to hex.

    0 讨论(0)
提交回复
热议问题