CSS all is used to reset all the css property of an HTML element.
This property is very useful when you want an HTML element to set properties to initial.
Syntax
1 |
all: enter value for it |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
<style> div.my-container{ display: flex; align-items: center; border:1px solid yellow; border-radius:20px; padding:10px; height: 305px; } div.my-container div{ width:100%; padding:2%; } .red{ background:red; align-self:flex-end; } .blue{ background:blue; all:initial; } .green{ background:green; } </style> <div class="my-container"> <div class="red"></div> <div class="blue"></div> <div class="green"></div> </div> |
Output
CSS all values list
Sr. No. | value | Description |
---|---|---|
1 | initial | Used to define as the property initial value. |
2 | inherit | Used to define the computed value of property on the elements parent. |
3 | unset | Used to define the property either acts as inherit or initial, depending on the property if it is inherited or not. |