请马上登录,朋友们都在花潮里等着你哦:)
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 马黑黑 于 2024-3-2 11:20 编辑
效果:
代码:
<style>
#mydiv {
margin: 60px auto;
width: 260px;
height: 260px;
background:
linear-gradient(red, tan),
linear-gradient(orange, pink),
linear-gradient(cyan, olive),
linear-gradient(lightblue, yellow);
background-repeat: no-repeat;
background-position: 0 0, 50% 0, 0 100%, 100% 100%;
background-size: 50% 50%;
clip-path: polygon(0 50%, 33.3% 33.3%, 50% 33.3%, 50% 0, 66.6% 33.3%, 66.6% 50%, 100% 50%, 66.6% 66.6%, 50% 66.6%, 50% 100%, 33.3% 66.6%, 33.3% 50%);
position: relative;
}
#mydiv:before, #mydiv::after { position: absolute; content: ''; }
#mydiv::before {
inset: 25%;
background:
linear-gradient(to top right, transparent 49.5%, #ccc 50%, transparent 50.5%),
linear-gradient(to bottom right, transparent 49.5%, #ccc 50%, transparent 50.5%);
}
#mydiv::after {
left: calc(50% - 10px);
top: calc(50% - 10px);
width: 12px;
height: 12px;
background: red;
border: 4px solid white;
border-radius: 50%;
}
</style>
<div id="mydiv"></div>
|