css技巧
1. :root定义全局样式
<div class="app">
</div>
---------------
:root {
--heer--background:skyblue;
}
.app{
width:200px;
height:200px;
background:var(--heer--background);
}
2.attr()获取被选取的元素值
<div id="app">
<p data="qwe">
def
</p>
</div>
------------------
[data]::before{
content:attr(data);
}

浙公网安备 33010602011771号