h5新属性、vue样式
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<div class="cls1" style="width: 300px; height: 300px;">
<div class="cls2" style="width: 90%; height: 50%;">
</div>
<div class="cls3" style="width: 95%; height: 50%;">
</div>
</div>
</body>
<style>
.cls2{
background-color: gold;
}
.cls3{
background-color: goldenrod;
}
</style>
<style scoped="scoped">
.cls3{
background-color: darkmagenta;
}
</style>
</html>
结论:
scoped的优先级更强,起效的是scoped
效果: