html5 - css 這種六邊形的邊框怎么畫(huà)?
問(wèn)題描述
用一個(gè)p+css怎么實(shí)現(xiàn)?
還這種可以填充顏色的
求代碼!
問(wèn)題解答
回答1:<html> <head> <style> .sixedge{ height: 24px; width: 55px; position:relative; background-color: #FFF; border-top:1px solid green; border-bottom:1px solid green; margin-left:40%; } .sixedge:after{ content: ’’; position: absolute; background-color: transparent; top: 3px; right: -9px; width: 17px; height: 17px; transform: rotate(45deg); -ms-transform: rotate(45eg); -moz-transform: rotate(45deg); -webkit-transform: rotate(45deg); -o-transform: rotate(45deg); border-top: 1px solid green; border-right: 1px solid green; }.sixedge:before{ content: ’’; position: absolute; background-color: transparent; top: 3px; left: -9px; width: 17px; height: 17px; transform: rotate(45deg); -ms-transform: rotate(45eg); -moz-transform: rotate(45deg); -webkit-transform: rotate(45deg); -o-transform: rotate(45deg); border-bottom: 1px solid green; border-left: 1px solid green; } </style></head> <body> <p class='sixedge'>six</p> </body> </html>回答2:
最簡(jiǎn)單的是,拆分成左中右,三塊,2個(gè)三角形和一個(gè)矩形,然后合成,3個(gè)p
回答3:鏈接給你 自己畫(huà)吧
回答4:<p class='rectangle'>新手</p>.rectangle{
margin:0 auto;width:200px;height:51px;line-height:51px;text-align:center;position:relative;border-top:1px solid #00F;border-bottom:1px solid #00F;
}.rectangle:before{
content:'';position:absolute;top:7px;left:-19px;width:36px;border-top:1px solid #00F;height:36px;border-right:1px solid #00F;transform:rotate(-135deg);
}.rectangle:after{
content:'';position:absolute;top:7px;right:-19px;width:36px;border-top:1px solid #00F;height:36px;border-right:1px solid #00F;transform:rotate(45deg);
}
回答5:@machenchi0207 六邊形外框
借用 @machenchi0207 的代碼
回答6:CSS3漸變實(shí)現(xiàn)切角效果詳情見(jiàn)《css揭秘》第三章的切角效果
就是利用偽類 然后給大小為0, 邊框加上像素就是了,多試一下
相關(guān)文章:
1. javascript - 編程,算法的問(wèn)題2. javascript - jQuery each 方法第三個(gè)參數(shù)args 如何解釋?3. ubuntu apt-get install update 無(wú)法更新4. webgl - android上類似汽車(chē)之家的3d全景照片怎么實(shí)現(xiàn)5. java - 阿里的開(kāi)發(fā)手冊(cè)中為什么禁用map來(lái)作為查詢的接受類?6. javascript - 為什么嵌套的Promise不能按預(yù)期捕獲Exception?7. css3 - Typecho 后臺(tái)部分表單按鈕在 Chrome 下出現(xiàn)靈異動(dòng)畫(huà)問(wèn)題,求解決8. apache - 想把之前寫(xiě)的單機(jī)版 windows 軟件改成網(wǎng)絡(luò)版,讓每個(gè)用戶可以注冊(cè)并登錄。類似 qq 的登陸,怎么架設(shè)服務(wù)器呢?9. java - 關(guān)于i++的一個(gè)題目10. node.js - win7下,npm 無(wú)法下載依賴包,淘寶鏡像也裝不上,求幫忙???
