用html盒子做一个芬兰国旗的样式
<!DOCTYPE html>
<html>
<head>
<title>芬兰国旗</title>
<style>
.flag {
width: 400px;
height: 200px;
background-color: blue;
position: relative;
}
.cross {
width: 80%;
height: 20%;
background-color: white;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.vertical {
width: 20%;
height: 100%;
background-color: white;
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.horizontal {
width: 100%;
height: 20%;
background-color: white;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
</style>
</head>
<body>
<div class="flag">
<div class="cross">
<div class="vertical"></div>
<div class="horizontal"></div>
</div>
</div>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/bTwe 著作权归作者所有。请勿转载和采集!