javascript - css 三角形缺口,
問題描述
如圖:
這個三角形缺口是透明的,請問咋個實(shí)現(xiàn)
大家請注意問題的關(guān)鍵,三角形能看見后面的背景
問題解答
回答1:我之前的做法是在導(dǎo)航欄上弄弄多一行小小幾px高的p的全是白色背景被選中的那個背景為一種透明“有缺口白色背景”圖片
回答2:p { width: 0; height: 0; border: 10px solid #fff; border-top-color: transparent;}回答3:
透明的三角形大概是做不出來的。
但你可以做兩個白色的梯形,留出中間那個三角形的位置就行了。
回答4:用border修飾實(shí)現(xiàn)三角形,想要透明用rgba
p{
width: 0;height: 0;border: 10px solid transparent;border-top-color: rgba(0,0,0,0.4)
}
回答5:頁面地址發(fā)出來,研究一下就知道了
回答6:同意小U醬的說法,我也只想到這一個辦法:
——————————————華麗的分割線———————————————用rotate做出來的效果:
p::before { content: ''; display: block; position: absolute; bottom: 0; left: -10px; width: 20px; /*自己調(diào)*/ border: 10px solid transparent; border-bottom-color: white;}p::after { content: ''; display: block; position: absolute; bottom: 0; right: -10px; width: 88px; /*自己調(diào)*/ border: 10px solid transparent; border-bottom-color: white;}
相關(guān)文章:
1. android - weex 項目createInstanceReferenceError: Vue is not defined2. android - 哪位大神知道java后臺的api接口的對象傳到前端后輸入日期報錯,是什么情況?求大神指點(diǎn)3. PHPExcel表格導(dǎo)入數(shù)據(jù)庫怎么導(dǎo)入4. pdo 寫入到數(shù)據(jù)庫的內(nèi)容為中文的時候?qū)懭雭y碼5. javascript - 如圖,百度首頁,查看源代碼為什么什么都沒有?6. vue2.0+webpack 如何使用bootstrap?7. PHP類封裝的插入數(shù)據(jù),總是插入不成功,返回false;8. mac連接阿里云docker集群,已經(jīng)卡了2天了,求問?9. 微信渠道二維碼怎么使用?10. html5 - html元素select下拉列表在原生app里面為什么不能彈框顯示?
