8

Is there a way to change the color of the HTML5 element using CSS instead of JS? I need to customize qTips tooltip pointers using custom LESS CSS rules which I can't refer to using jQuery.

web_dvlp_sd
  • 167
  • 1
  • 2
  • 13
  • 1
    PS. I tried setting the color, background-color and border declarations for the canvas in CSS but that didn't work, the background color is applied but the element is still showing up on top of it in a different color. – web_dvlp_sd Apr 18 '12 at 17:23

1 Answers1

7

Yes, I don't know what the issue you are running into but I have a working jsfiddle here

<canvas></canvas>​

canvas {
    background: #cdcdcd;
    width:200px;
    height:200px;
}​
John Kalberer
  • 5,690
  • 1
  • 23
  • 27
  • Thanks, it seems like it should work but I think it's getting over-ridden somehow by the default JS file. I tried applying "!important" to the CSS rules but that didn't do it either. – web_dvlp_sd Apr 18 '12 at 18:07
  • Ahh... If the js is rendering to it somehow, you need to change the initialization code so that it grabs the CSS background color and sets it. I am not sure what exactly the canvas js is doing so I can't help more. – John Kalberer Apr 18 '12 at 18:16