Đây là sollution tôi
HTML:
<div id="shape"></div>
CSS:
#shape {
width:250px;
height:250px;
background:#448ccb;
position:relative;
}
#shape:before {
content:" ";
position:absolute;
width:250px;
height:250px;
background:#fff;
left:0; top:-50%;
border-radius:50%;
}
Link trong jsfiddler: demo
Solition với hộp-shadow:
HTML:
<div id="wrap">
<div id="shape"></div>
</div>
CSS:
#wrap {
background:#ccc;
padding:20px;
}
#shape {
width:250px;
height:250px;
position:relative;
overflow:hidden;
}
#shape:before {
content:" ";
position:absolute;
width:100%;
height:100%;
left:0; top:-50%;
border-radius:50%;
box-shadow:0 0px 0 250px #448ccb
}
Link trong jsfiddler: demo
đẹp câu hỏi :) – ShibinRagh
làm bạn cần phải nhìn xuyên qua nửa vòng tròn màu trắng? có nghĩa là nó sẽ hiển thị một hình nền, gradient ...? –
@ web-tiki Bạn có nghĩ điều đó có thể xảy ra không? – MightyPork