我有一個小問題,使邊界半徑的一個div中的兩個水平背景。我想要主div是一個圓圈。兩個背景水平在div一個圓角div
我的代碼
body{
text-align: center;
}
.split-outer {
position: relative;
display: inline-block;
width: 200px;
height: 200px;
z-index: 2;
background: #014495;
border-radius: 100%;
}
.split-outer::after{
content: "";
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 50%;
z-index: -1;
background: #fff;
border-bottom-right-radius: 200px;
border-bottom-left-radius: 200px;
}
.split-inner{
width: 200px;
height: 200px;
margin: 0 auto;
color: #fff;
text-align: center;
}
span{
display: block;
}
span.split-title{
padding: 30px 0 10px 0;
font-size: 55px;
text-align: center;
line-height: 55px;
}
span.split-content{
padding: 20px 0;
font-size:18px;
color: #014495;
}
<div class="container-fliud">
<div class="jumbotron">
<div class="split-outer">
<div class="split-inner">
<span class="split-title">100</span>
<span class="split-content">Lorem ipsum</span>
<button type="button" class="btn btn-primary btn-sm">Button</button>
</div>
</div>
</div>
</div>
但我有一個小bug,在元素後,我看到的第一個div一些藍色的底色線。它看起來像是從半徑生成的邊界線。但我喜歡乾淨的白色圓形背景。
Codepen一條:http://codepen.io/michal_t/pen/KdoZYz/
你爲什麼不使用背景圖片呢? – Ionut
http://codepen.io/Ararat/pen/wKmyzK?editors=110 –