如何在CSS3中製作以下形狀,而不使用像「:before」這樣的僞類?CSS3 Moon Eclipse shape
我做到了,很容易:前,但事情是,我不希望有灰色區域的固體元件(見的jsfiddle - http://jsfiddle.net/aUdLr/2/)
div{
width: 100px;
height: 100px;
background-color: red;
border-radius: 100%;
position: relative;
}
div:before{
content: "";
width: 100%;
height: 110%;
background: gray;
position: absolute;
left: 5px;
top: -5%;
border-radius: 100%;
}
[本網站](http://css-tricks.com/examples/ShapesOfCSS/)可能會對您有所幫助。儘管你的形狀沒有例子。 – AfromanJ
這可能也有幫助:[靈活的谷歌樣式加載器與CSS](http://lea.verou.me/2013/11/flexible-google-style-loader-with-css/) – Kobi