<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
list-style: none;
}
body {
--color_1: red; /* 全局声明样式*/
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.font {
width: 300px;
height: 300px;
background-color: var(--color_1);/*var()调用*/
border-radius: 50%;
}
</style>
</head>
<body>
<div class="font"></div>
</body>
</html>
css自定义样式属性值
于 2022-08-01 11:11:00 首次发布