【发布时间】:2017-10-23 23:42:20
【问题描述】:
【问题讨论】:
标签: html css ionic-framework sass
【问题讨论】:
标签: html css ionic-framework sass
这是我的方法:
#background {
width: 100vw;
height: 100vh;
background: tomato;
overflow: hidden;
position: fixed;
}
#background::before {
content: "";
display: block;
width: 200vw;
height: 200vw;
border-radius: 50%;
background: green;
position: absolute;
bottom: 50vh;
left: 50%;
transform: translateX(-50%);
}
#wrapper {
position: relative;
color: #fff;
text-align: center;
}
<div id="background"></div>
<div id="wrapper">Some content above the background element</div>
【讨论】:
您可以将:after 伪元素用于蓝色部分,并将@987654322@ 设置为父元素。
.el {
width: 40%;
height: 300px;
background: #B5B5B5;
position: relative;
overflow: hidden;
}
.el:after {
content: '';
background: #48B2FF;
height: 150%;
width: 200%;
border-radius: 50%;
position: absolute;
left: 50%;
top: 0;
transform: translate(-50%, -70%);
}
<div class="el"></div>
【讨论】: