亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

使用CSS實現(xiàn)中間鏤空的圖片遮罩效果

bokeyy   發(fā)布時間:2015-12-24 12:08:16   作者:袁源   我要評論
這篇文章主要介紹了使用CSS實現(xiàn)中間鏤空的圖片遮罩效果的方法,文中同時附帶介紹了一個用CSS3實現(xiàn)的鏤空一個圓形的代碼示例,需要的朋友可以參考下

中間鏤空的圖片遮罩指的大概就是這樣一個效果:

20151224120939344.png (383×279)

鏤空一個洞的代碼

CSS Code復(fù)制內(nèi)容到剪貼板
  1. <div id="container" style="position: relative; margin: 550px 0 0 50px;">   
  2. <svg style="position: absolute;" width="400" height="280">   
  3. <defs>   
  4. <mask id="mask3">   
  5. <rect x="0" y="0" width="100%" height="100%" style="stroke:none; fill: #ccc"></rect>   
  6. <circle id="circle1" cx="100" cy="100" r="50" style="fill: #000" />   
  7. </mask>   
  8. </defs>   
  9. <rect x="0" y="0" width="100%" height="100%" style="stroke: none; fill: #ccc; mask: url(#mask3)"></rect>   
  10. </svg>   
  11. <img src="http://img6.cache.netease.com/cnews/2014/11/3/20141103100737855b7.jpg" />   
  12. </div>  

鏤空多個洞的代碼

CSS Code復(fù)制內(nèi)容到剪貼板
  1. <div id="container" style="position: relative;">   
  2. <svg style="position: absolute;" width="400" height="280">   
  3. <defs>   
  4. <mask id="mask3">   
  5. <rect x="0" y="0" width="100%" height="100%" style="stroke:none; fill: #ccc"></rect>   
  6. <circle id="circle1" cx="100" cy="50" r="50" style="fill: #000" />   
  7. <circle id="circle1" cx="300" cy="100" r="50" style="fill: #000" />   
  8. <circle id="circle1" cx="100" cy="200" r="50" style="fill: #000" />   
  9. </mask>   
  10. </defs>   
  11. <rect x="0" y="0" width="100%" height="100%" style="stroke: none; fill: #ccc; mask: url(#mask3)"></rect>   
  12. </svg>   
  13. <img src="http://img6.cache.netease.com/cnews/2014/11/3/20141103100737855b7.jpg" />   
  14. </div>  

 

CSS3 版

用 box-shadow ,代碼如下:

CSS Code復(fù)制內(nèi)容到剪貼板
  1. positionfixed;   
  2. left150px;   
  3. top35px;   
  4. width100px;   
  5. height100px;   
  6. border-radius: 100px;   
  7. box-shadow: rgba(0,0,0,.8) 0px 0px 0px 2005px;   
  8. z-index: 100;  

缺點是只能鏤空一個洞。

 

相關(guān)文章

  • CSS實現(xiàn)鏤空遮罩效果

    這篇文章主要介紹了CSS實現(xiàn)鏤空遮罩效果,本文給大家介紹的非常詳細(xì),具有一定的參考借鑒價值,需要的朋友可以參考下
    2019-08-20
  • 用純CSS實現(xiàn)鏤空效果的示例代碼

    這篇文章主要介紹了用純CSS實現(xiàn)鏤空效果的示例代碼的相關(guān)資料,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2019-02-25
  • CSS實現(xiàn)鏤空效果的示例代碼

    這篇文章主要介紹了CSS實現(xiàn)鏤空效果的示例代碼的相關(guān)資料,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-12-24
  • CSS3中文字鏤空、透明值、陰影效果設(shè)置示例小結(jié)

    這篇文章主要介紹了CSS中文字鏤空、透明值、陰影效果設(shè)置示例小結(jié),其中通過text-stroke-color透明值的設(shè)置可以讓文字在某些程度上更加柔和,需要的朋友可以參考下
    2016-03-07
  • CSS背景色鏤空技術(shù)實際應(yīng)用及進(jìn)階分享

    這篇文章主要介紹了CSS背景色鏤空技術(shù)實際應(yīng)用及進(jìn)階相關(guān)資料,需要的朋友可以參考下
    2013-10-10
  • css3遮罩層鏤空效果的多種實現(xiàn)方法

    這篇文章主要介紹了css3遮罩層鏤空效果的多種實現(xiàn)方法,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)
    2020-05-11

最新評論