View on GitHub
Opacity不透明度
Control the opacity of elements.控制元素的不透明度。
The opacity
property sets the opacity level for an element. opacity
属性设置元素的不透明度级别。The opacity level describes the transparency level, where 不透明度级别描述了透明度级别,其中1
is not transparent at all, .5
is 50% visible, and 0
is completely transparent.1
根本不透明,.5
为50%可见,0
为完全透明。
Set the 使用opacity
of an element using .opacity-{value}
utilities..opacity-{value}
实用程序设置元素的opacity
。
100%
75%
50%
25%
<div class="opacity-100">...</div>
<div class="opacity-75">...</div>
<div class="opacity-50">...</div>
<div class="opacity-25">...</div>
Utilities API实用程序API
Opacity utilities are declared in our utilities API in 不透明实用程序在scss/_utilities.scss
. scss/_utilities.scss
中的实用程序API中声明。Learn how to use the utilities API.了解如何使用实用程序API。
"opacity": (
property: opacity,
values: (
0: 0,
25: .25,
50: .5,
75: .75,
100: 1,
)
),