請幫我我要讓一個div像這樣如何在css中繪製內半徑?
3
A
回答
3
方法#01:
body {
background: #f0f0f0;
margin: 0;
}
.box {
background: radial-gradient(circle at bottom right, transparent 60px, #000 60px);
height: 150px;
width: 250px;
}
<div class="box"></div>
方法#02:
您可以:before
或:after
僞元素和box-shadow
CSS屬性的組合來創建它。
body {
background: #f0f0f0;
margin: 0;
}
.box {
position: relative;
overflow: hidden;
height: 150px;
width: 250px;
}
.box:before {
box-shadow: 0 0 0 1000px #000;
border-radius: 100%;
position: absolute;
bottom: -30px;
height: 100px;
right: -35px;
width: 100px;
z-index: -1;
content: '';
}
<div class="box"></div>
3
的最簡單的方法將使用pseudo element
。通過絕對定位:after
元素,您可以獲得理想的效果。
.box {
background: #000;
width: 300px;
height: 150px;
position: relative;
}
.box:after {
content: '';
position: absolute;
width: 150px;
height: 150px;
border-radius: 50%;
background: #fff;
right: -75px;
bottom: -75px;
}
<div class="box"></div>
2
試試這個CSS,
.rec{
height: 200px;
background: black;
position: relative;
width:600px;
}
.rec:after {
content: '';
position: absolute;
bottom: -20px; right: -20px;
border-bottom: 100px solid white;
border-left: 100px solid white;
width: 0;
background:#fff;
border-radius:150px;
}
相關問題
- 1. 在D3中繪製半徑
- 2. 在CSS中繪製半圈
- 3. 如何從半徑和內角度在Silverlight中繪製弧線
- 4. 如何繪製所有邊框半徑的CSS petagon?
- 5. 如何在Android中的谷歌地圖在特定半徑內繪製標記
- 6. 如何在Matlab中繪製球體時定義半徑?
- 7. 如何製作內邊界半徑?
- 8. 在django的olwidget上繪製半徑
- 9. 設置邊框半徑時在元素內部繪製CSS邊框
- 10. 如何在C#中繪製半角?
- 11. CSS如何使內部的div邊框半徑與外層div邊框半徑
- 12. 如何繪製半圓
- 13. 如何繪製一個圓頂在MATLAB /不同半徑?
- 14. 如何在谷歌地圖上繪製虛線( - )半徑swift?
- 15. 在Pygame中繪製半圓
- 16. 爲繪製UIImageView設置圓角半徑
- 17. 圓角半徑可繪製形狀
- 18. 繪製半徑增加的弧線?
- 19. Androidplot繪製圓,給點和半徑
- 20. 使用邊框半徑繪製圓圈
- 21. 如何繪製Python中的半橢圓?
- 22. css中的邊框半徑
- 23. 使用谷歌地圖的半徑內的繪製點
- 24. 邊框半徑div內的CSS動畫
- 25. 邊界半徑CSS
- 26. CSS邊界半徑
- 27. CSS - 邊框半徑
- 28. CSS邊界半徑
- 29. 如何在半徑增加時在CLLocationManager中繪製區域的固定圓圈
- 30. 如何繪製給定高度和半徑的圓錐
請告訴我們你有什麼到目前爲止已經試過。 –
我試圖用邊界半徑,但是繪製其他方式。 – Shahid
即使它不起作用,請向我們顯示您的代碼,我們會盡力幫助您解決您的問題。 –