Search
 
SCRIPT & CODE EXAMPLE
 

CSS

css variables not working

First, declare your variable in :root. This ensures that all scopes can access it.
You do it like so:

:root {
	--bg-color: #0F0A0A; /* Blackish */
}

Whenever you use it, wrap it in a var() function like this:

body {
	background: var(--bg-color);
}

Now it should work! I tend to forget the var() part the most.
Comment

PREVIOUS NEXT
Code Example
Css :: three dots animation 
Css :: vendor css 
Css :: material css sidebar 
Css :: css flexbox layout examples 
Css :: backface-visibility: hidden; 
Css :: transparent circle css 
Css :: linear gradient css 
Css :: generate css on scss save 
Css :: nth-child css 
Css :: initialize toast 
Css :: box shadow css transition 
Css :: @page css 
Css :: disable dequeue contact form7 
Css :: enque script only on specific archive page 
Css :: css absolute z index less than 
Css :: css conflicting styles 
Css :: css marker effect 
Css :: truncate long line with dots 
Css :: centering icons in footer 
Css :: fix materialize form label not working 
Css :: btn keeps pushing down on window resize 
Css :: scss modules 
Css :: CSS style all div elements 
Css :: css code for flash messages flask 
Css :: transform: scale time anpassen 
Css :: css color keywords 
Css :: transition all except one property 
Css :: tf.reduce_mean(y_true,y_predicted) 
Css :: css accordian triangle 
Css :: how to use figure in spsific size css 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =