Skip to content
Sign upLog in
← Back to Community
How to make a variable?
Profile icon
RixTheTyrunt

Well, this is an another programming language than Python... It's HTML, CSS, JavaScript! So, I have a problem on CSS... I want to make a variable ( I know, that CSS variables start with -- ) in CSS, named --current-sans-serif with a value 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif, could anyone help me, please?-

Answered by ch1ck3n [earned 5 cycles]
View Answer
Voters
Profile icon
RixTheTyrunt
Comments
hotnewtop
Profile icon
ch1ck3n
:root { --blue: #1e90ff; --white: #ffffff; }

is how to set the variables

and this is how to get those variables

body { background-color: var(--blue); }
Profile icon
RixTheTyrunt

@ch1ck3n
Oh, OK!

Profile icon
RixTheTyrunt