久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術(shù)文章
文章詳情頁

html - css div怎么和它的偽類after共用一樣背景圖片?

瀏覽:137日期:2023-01-29 09:30:31

問題描述

怎么用p畫出這樣的效果html - css div怎么和它的偽類after共用一樣背景圖片?

p怎么和它的偽類after共用一樣背景圖片?能實(shí)現(xiàn)嗎?

問題解答

回答1:

css clip可以實(shí)現(xiàn)

clip-path: polygon(0% 0%, 100% 0%, 100% 75%, 75% 75%, 75% 100%, 50% 75%, 0% 75%);

http://bennettfeely.com/clippy/

回答2:

確實(shí)需要點(diǎn)小trick,寫了一個(gè)看看如何代碼如下:

<body><p class='main'></p></body>

.main { position: relative; width: 412px; height: 261px; background:url(’http://pic.baike.soso.com/p/20130828/20130828162541-2121279471.jpg’) no-repeat; border-radius: 10px;}.main:after { position: absolute; top: 261px; left: 20px; width: 20px; height: 20px; content: ’’; box-sizing: border-box; border-top: 20px solid transparent; border-left: 20px solid #f3f5f6; border-right: 20px solid #f3f5f6; background: inherit; background-position: -20px bottom; background-origin: border-box; }

html - css div怎么和它的偽類after共用一樣背景圖片?

https://jsfiddle.net/ycwalker...

回答3:

1、可以畫三角形2、可以這樣:把背景色換為你需要的圖片,注意色差!.d1{

position: relative;border: 1px dashed #999;background: #fff;width: 150px;height: 100px;

}

.d1 span{

display: block;width: 20px;height: 20px;position: absolute;border-right:1px dashed #999;border-bottom:1px dashed #999;transform: rotate(45deg);bottom: -10px;left: 50%;margin-left:-15px;background: #fff;z-index: 99;

}3、直接PS扣圖最直接了。

回答4:

inherit , inherit 使用繼承。

標(biāo)簽: HTML
相關(guān)文章:
主站蜘蛛池模板: 柳江县| 庆元县| 柳河县| 西丰县| 宜州市| 平昌县| 石泉县| 汕头市| 潮安县| 正蓝旗| 乌兰县| 南部县| 武平县| 稷山县| 中西区| 比如县| 分宜县| 左云县| 新宁县| 井陉县| 古浪县| 蓬莱市| 大邑县| 陇南市| 大余县| 勐海县| 东光县| 富阳市| 瑞昌市| 汉寿县| 明光市| 卫辉市| 沅江市| 龙泉市| 福州市| 蒲城县| 信宜市| 金寨县| 沙雅县| 焦作市| 三河市|