-1
A
回答
1
與第一個答案去。
有一個簡單得多的方式來做到這一點使用
pseudo-elements
。好處是您只需要一個class
就可以完成整個佈局。很簡單。
*{
margin: 0;
}
.circle{
width: 100px;
height: 100px;
background: #f4c741;
border-radius: 50%;
position: relative;
margin: 50px auto;
}
.circle:before, .circle:after{
content: '';
position: absolute;
border-radius: 50%;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.circle:before{
width: 100px;
height: 100px;
border: 15px solid #f4d041;
}
.circle:after{
border: 20px solid #f4e242;
width: 125px;
height: 125px;
}
<div class="circle"></div>
2
我堅持這個border.I不明白我怎麼能做出這種 類型border.If任何人建議我,它會幫助我很多。
下面的東西應該會創建圓角,但是,如果您認爲有必要插入合適的圖像並更改顏色,則由您決定。
我已經使用了CSS3
border-radius
屬性,提供了div
元素「圓角」。
<!DOCTYPE html>
<html>
<head>
<style>
#rcorners1 {
border-radius: 150px;
background: #f4e242;
padding: 20px;
width: 200px;
height: 200px;
}
#rcorners2 {
border-radius: 150px;
background: #f4d041;
padding: 20px;
width: 160px;
height: 160px;
}
#rcorners3{
border-radius: 150px;
background: #f4c741;
padding: 20px;
width: 120px;
height: 120px;
}
</style>
</head>
<body>
<div id="rcorners1">
<div id="rcorners2">
<div id="rcorners3">
</div>
</div>
</div>
</body>
</html>
相關問題
- 1. UIBezierPath:如何在帶圓角的視圖周圍添加邊框?
- 2. CSS - 如何在圓形圖像周圍添加圓形邊框/輪廓?
- 3. 使用Raphael在圖像周圍繪製圓角邊框
- 4. 圓角邊框周圍IMG犯規秀
- 5. 如何在TableLayout周圍添加邊框?
- 6. 如何在QWidget周圍添加邊框?
- 7. 如何向圓角圖像添加圓角邊框(使用邊框半徑圓角)
- 8. CSS:如何添加具有邊框和無圖像的圓角?
- 9. 圖像周圍的邊框
- 10. 選擇性地在圖像視圖周圍添加邊框
- 11. 如何在邊框周圍添加另一個邊框?
- 12. 如何使用php在圖像中添加帶圓角邊框的框?
- 13. 在旋轉木馬的圖像部分周圍添加邊框
- 14. 在圖像周圍添加透明邊框
- 15. 使用CSS在圖像周圍創建圓形邊框
- 16. 在圓形圖像周圍生成平滑的白色邊框
- 17. 字段集和圖例周圍的正確的圓角邊框
- 18. 添加圖像周圍添加圖像
- 19. 如何在R中的圖例周圍添加邊框?
- 20. 將邊框添加到圓形圖像
- 21. 將邊框添加到圓形圖像
- 22. Silverlight:在網格周圍添加邊框
- 23. QLabel在文字周圍添加「邊框」
- 24. 圖像精靈僞造內容周圍的圓形邊框?
- 25. 如何使用CSS在圖像周圍添加非矩形邊框?
- 26. Android:操縱圖像並在圖像周圍添加白色邊框
- 27. 如何在圓形圖像上添加陰影和邊框androidView?
- 28. 在橢圓形的圖畫框周圍繪製邊框
- 29. 添加圓角色邊框iTextSharp的
- 30. 的Webkit:圖像覆蓋圓角邊框
你有沒有試着用搜索引擎術語 「多邊界」 或 「梯度邊界?」我做了,我立即想出了幾個解決方案。互聯網是人類歷史上最偉大的研究工具。不要使用它不要欺騙自己。 – MarsAtomic