Contents
The opacity
property sets the opacity level for an element. The opacity level describes the transparency level, where 1
is not transparent at all, .5
is 50% visible, and 0
is completely transparent.
Quick reference
Class | Properties |
---|---|
.opacity-0 | opacity: 0; |
.opacity-25 | opacity: 0.25; |
.opacity-50 | opacity: 0.5; |
.opacity-75 | opacity: 0.75; |
.opacity-100 | opacity: 1; |
Basic usage
Set the opacity
of an element using .opacity-{value}
utilities.
100%
75%
50%
25%
<div class="opacity-100">...</div>
<div class="opacity-75">...</div>
<div class="opacity-50">...</div>
<div class="opacity-25">...</div>
Edit this page on Github
Last edited by zhengchun on November 30, 2023