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

VAR IN CSS

/* var */
:root{
    --blue--:#2874f0;
}
/* Css reset */
* {
    margin: 0;
    padding: 0;
}

/* header styles */
header {
    background-color: var(--blue--);
    position: sticky;
    top: 0;
    height: 5vw;
    display: flex;
    justify-content: center;
    align-items: center;
}
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 :: justify xd 
Css :: chrome developer tools send get request 
Css :: deploy truffle project on testnet 
Css :: col-md-6 bootstrap 
Css :: display flex overflow hidden slider 
Css :: installation tailwind css in html 
Css :: how to disable keyboard in windows 10 
Css :: showing two iframes side by side 
Css :: red color hex 
Css :: border css 
Css :: send element to center of div 
Css :: css style select arrow color 
Css :: css display offscreen 
Css :: login page ui html css 
Css :: Tailwindcss Breadcrumb 
Css :: font awesome icons showing squares before after 
Css :: css image responsive on screen zoom 
Css :: Scrollbar inside a website 
Css :: CSS transition slide down 
Css :: in 10 seconds fade in a card html css 
Css :: advanced selectors 
Css :: CSS Height, Width and Max-width 
Css :: resctrict css to apply on div 
Css :: object-fit: cover; 
Css :: ipad pro css 
Css :: transform in css 
Css :: tailwind transition 
Css :: css font weight 
Css :: neumorphism css generator 
Css :: whats display block 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =