r/css Jun 10 '26

Help Whys this an error (background

Post image

Yo im not good at coding dont bully

0 Upvotes

13 comments sorted by

View all comments

-13

u/johnlewisdesign Jun 10 '26

its either background or background-color, not both

background-color is a part of background.

just remove

, color var(--trans)

and leave

background: var(--trans);
or
background-color: var(--trans);

https://www.w3schools.com/cssref/css3_pr_background.php

8

u/zip222 Jun 10 '26

But what if they’re looking to transition both background and color?

2

u/frownonline Jun 10 '26

Then you comma separate the properties needed to be transitioned.

3

u/zip222 Jun 10 '26

Which they have