Search
 
SCRIPT & CODE EXAMPLE
 

CSS

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 :: google font smooth 
Css :: flexbox css 
Css :: bootstrap-navbar-containers 
Css :: css position property 
Css :: html css drow line 
Css :: add css class c# 
Css :: css custom cursor form image 
Css :: how we use backdrop-filter css property 
Css :: scss background color 
Css :: min function css 
Css :: chrome developer tools css customize 
Css :: boxsizing 
Css :: css focus input change another element 
Css :: css-loader 
Css :: blurring behind a div 
Css :: padding 
Css :: nth-child css 
Css :: css homepage 
Css :: css calc margin-top based on height? 
Css :: align center without using margin 
Css :: inline-block column appear higher than others 
Css :: combine text styles 
Css :: access lamp folder using terminal mac 
Css :: how to make code continue after a transition css 
Css :: cant change button higeht in @media 
Css :: how to take of underline from link through css 
Css :: style input type range shaded part only 
Css :: target css selector 
Css :: transform: scale time anpassen 
Css :: how to style boxicon icons in css 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =