0
HTML/CSS form background color - variables
Does anybody know why background-color: var(—my-chosen-color) doesn’t work? same question when trying to set width on Media Query with an variable length (px,em,vw)
2 Réponses
+ 1
1. CSS variable must be prefixed -- (two minus sign)
2. You need to define them first
:root{
--my-chosen-color: black;
}
3. If above doesn't help. Please show your code here so that we can help you
https://www.sololearn.com/post/75089/?ref=app
0
Yes i did defined them and prefixed them wih - -, i whanted to set the border color like this :
table, tr, th, td {
border-color: var(—default-color);
i tryed to set MQ like this :
@media (min-width: var(dafult-tablet-width));
both vars were set corectly as they works fine in background and color properties