Search
 
SCRIPT & CODE EXAMPLE
 

CSS

css set variable

:root {
  --main-bg-color: coral;
}

#div1 {
  background-color: var(--main-bg-color);
}

#div2 {
  background-color: var(--main-bg-color);
}
Comment

css variable

:root {
  --main-bg-color: pink;
}
body {
  background-color: var(--main-bg-color);
}
Comment

css variables

:root {
  --background-color: #333;
  --text-color: #fff;
}
body {
  background-color: var(--background-color);
  color: var(--text-color);
}
Comment

variables css

:root {
    --main-bg-color: brown;
  }
  
.uno {
    color: white;
    background-color: var(--main-bg-color);
    margin: 10px;
    width: 50px;
    height: 50px;
    display: inline-block;
}
Comment

css variables

:root {
  --first-color: #16f;
  --second-color: #ff7;
}

#firstParagraph {
  background-color: var(--first-color);
  color: var(--second-color);
}

#secondParagraph {
  background-color: var(--second-color);
  color: var(--first-color);
}

#container {
  --first-color: #290;
}

#thirdParagraph {
  background-color: var(--first-color);
  color: var(--second-color);
}
Comment

create variable in css

:root {
  --tab-count: 5;
}

#div1 {
  width: calc(100% - var(--tab-count));
}
Comment

how to use variables in css

:root {
  --clr-primary-1: hsl(205, 86%, 17%);
}

.container{
  background-color: var(--clr-primary-3);
}
Comment

css variable

...
<style>
	:root{
  		--couleur-principale: brown;
	}
	#test1{
		color:var(--couleur-principale);
	}
</style>
...
Comment

CSS Variables

body { background-color: #1e90ff; }

h2 { border-bottom: 2px solid #1e90ff; }

.container {
  color: #1e90ff;
  background-color: #ffffff;
  padding: 15px;
}

button {
  background-color: #ffffff;
  color: #1e90ff;
  border: 1px solid #1e90ff;
  padding: 5px;
}
Comment

PREVIOUS NEXT
Code Example
Css :: schatten css 
Css :: align center img css inside div 
Css :: chrome hide blue highlight css mobile 
Css :: ion-item no padding ionic 4 
Css :: font size css 
Css :: align center 
Css :: how to enlarge image when hover on in css 
Css :: ho to choose the first child of parent in css 
Css :: print media css 
Css :: scss transition 
Css :: keeping elements of container in center 
Css :: invert png color css 
Css :: change height of range slider html 
Css :: div align right in css 
Css :: html dim entire screen 
Css :: elementor is swiping 
Css :: rgb white 
Css :: make a paragraph fit in div 
Css :: Hide Google Recaptcha V3 | how to hide the reCaptcha v3 badge 
Css :: css change image saturation 
Css :: how to position something on the same line css 
Css :: center div content 
Css :: css text fill all the width possible 
Css :: roboto google apis 
Css :: how to round the corners of a div outline in css 
Css :: centering with flexbox 
Css :: select all class in css 
Css :: remove list dots on li 
Css :: css cursor loading 
Css :: css animation stay at end 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =