设计师设计了标志。它将需要在各种条件下使用。为了尽可能方便,请在纯 CSS 中使用单个 HTML 元素对其进行布局。
您不能使用图片(即使通过 data:uri)。
我尝试使用伪元素,但它不起作用。笔记
div {
width: 180px;
height: 180px;
}
div:before{
content:"";
width: 180px;
height: 90px;
background: #f8e34b;
}
div:after {
content: "";
width: 90px;
left: 0;
height: 90px;
background: #eeedef;
}
div:after{
content: "";
width: 90px;
height: 90px;
right: 0;
background: #0c0c0c;
}
<div></div>
多背景可以做到这一点:
.box {
width:180px;
height:180px;
border-radius:9px;
background:
linear-gradient(#f8e34b,#f8e34b) top /100% 50%,
linear-gradient(178deg,#c8c8c8 30%, transparent 70%)
0 calc(50% + 4px) /50% 8px,
linear-gradient(#0c0c0c,#0c0c0c) bottom right/50% 50%,
#eeedef;
background-repeat:no-repeat;
}
<div class="box"></div>
与了解不同值相关:在线性渐变上使用具有背景位置的百分比值
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句