CSS3 border凹陷該如何編寫?
問題描述
本人新手,請(qǐng)問各位大神,如此,該如何編寫CSS3 ? (我說的是藍(lán)色的部分) 謝謝了~~
問題解答
回答1:我的思路:絕對(duì)定位+after/before偽類實(shí)現(xiàn),大致實(shí)現(xiàn)的效果如下:
TZ可以參見給的demo自行修改一下:在線demo
回答2:如果換個(gè)思路的話,可以把那個(gè)圓的margin設(shè)置成背景色,然后蓋住右側(cè),這樣看上去就像是凹進(jìn)去的效果了。
回答3:首先更正一下一樓的答案,after/before是偽元素而不是偽類,這個(gè)很重要,不能把這個(gè)弄混淆了,如果是我我會(huì)用一個(gè)大圓覆蓋長(zhǎng)條,再用小圓覆蓋大圓就好了
回答4:<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'><head> <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'> <title>css</title></head><body><style>#a { width: 150px; height: 300px; background: radial-gradient(circle at top left, transparent 15px, #e6e4b7 0) top left, radial-gradient(circle at top right, transparent 15px, #e6e4b7 0) top right, radial-gradient(circle at bottom right, transparent 15px, #e6e4b7 0) bottom right, radial-gradient(circle at bottom left, transparent 15px, #e6e4b7 0) bottom left; background-size: 50% 50%; background-repeat: no-repeat; padding: 20px 24px 22px 20px;}#b { display: block; background: radial-gradient(circle at top left, transparent 15px, red 0) top left, radial-gradient(circle at top right, transparent 15px, red 0) top right, radial-gradient(circle at bottom right, transparent 15px, red 0) bottom right, radial-gradient(circle at bottom left, transparent 15px, red 0) bottom left; background-size: 50% 50%; background-repeat: no-repeat; width:100%; height: 100%; padding: 2px;}#b:before { content: ''; width: 100%; height: 100%; display: block; background: radial-gradient(circle at top left, transparent 15px, #e6e4b7 0) top left, radial-gradient(circle at top right, transparent 15px, #e6e4b7 0) top right, radial-gradient(circle at bottom right, transparent 15px, #e6e4b7 0) bottom right, radial-gradient(circle at bottom left, transparent 15px, #e6e4b7 0) bottom left; background-size: 50% 50%; background-repeat: no-repeat;}</style> <p id='a'><p id='b'></p> </p></body></html>
相關(guān)文章:
1. javascript - JS設(shè)置Video視頻對(duì)象的currentTime時(shí)出現(xiàn)了問題,IE,Edge,火狐,都可以設(shè)置,反而chrom卻...2. java固定鍵值轉(zhuǎn)換,使用枚舉實(shí)現(xiàn)字典?3. 如何為每個(gè)應(yīng)用程序配置tomcat 6的logs / catalina.out。(為sys.out,sys.err配置Web應(yīng)用程序特定的日志文件)4. css - ionic中的柵格布局如何讓文字內(nèi)容多少不同的每一列中的內(nèi)容都能垂直居中?5. php自學(xué)從哪里開始?6. phpstady在win10上運(yùn)行7. java - 我設(shè)置了cookie的max age,但是cookie依然在關(guān)閉游覽器后消失了8. vim - win10無法打開markdown編輯器9. 這是什么情況???10. javascript - 用jsonp抓取qq音樂總是說回調(diào)函數(shù)沒有定義
