canvas.style.background = "red"; // a valid CSS colour. You are filling the canvas with a transparent colour, if you want a colour that is the result of the element's background colour and the transparent fill you need to calculate the correct background colour that when combined gives you the colour you want.
In your case, the print-color-adjust: exact is working. However, your background-color and color definitions are being beaten out by other CSS with higher specificity. While I do not endorse using !important in nearly any circumstance, the following definitions work properly and expose the problem:
The background property is a shorthand property that allows you to set multiple background-related properties in one declaration. These properties include background-color, background-image, background-repeat, background-position, and others.
37 Based on MDN Web Docs you can set multiple background using shorthand background property or individual properties except for background-color. In your case, you can do a trick using linear-gradient like this:
Is it possible to set the color of the "bar" for the <progress> element in HTML (when you specify a value, the bar is filled up to the point of the value)? If so, how? background-color and background don't seem to have any effect.
What I want is for the green background to be just behind the text, not to be 100% of the page width. Here is my current code: h1 { text-align: center; background-color: green; } &l...
Does not answer the question--OP wants to change the background-color of the options when the menu is expanded, not the background-color of the default/currently-selected option when the menu is closed.
background-color background-image background-position background-repeat background-attachment background-clip background-origin background-size Thus, besides the background-color, using the background shorthand you could also add one or more values without repeating any other background-* property more than once. Which one to choose is essentially up to you, but it could also depend on ...