css3 - css怎么做出這樣的效果?
問題描述
中間的那個比周圍亮的區(qū)域怎么做?。?img alt='css3 - css怎么做出這樣的效果?' src=''http://www.intensediesel.com/wenda/php/' target='_blank'php/a.cn/upload/image/000/000/000/faa463ad8c7cb79a49cd871a43d042fa-0.png'>
問題解答
回答1:.mask { position: fixed; z-index: 10000; left: 50%; top: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); width: 300px; height: 100px; outline: 1000px solid rgba(0, 0, 0, 0.5);}<p class='mask'></p>回答2:
用背景色做成的demo 如下
https://codepen.io/jackpan/pe...
用box-shadow 或者 outline做成的demo如下:https://codepen.io/jackpan/pe...
回答3:正確的方法是使用 box-shadow,如: box-shadow: 0 0 0 2560px rgba(0,0,0,0.8)
回答4:我覺得有2種做法:1、用4個 p 做出它四周比較暗的區(qū)域。2、背景圖上遮罩1個p做出比較暗的地方,然后最頂上一個p里放進同一張背景圖,定位到合適的位置。
回答5:filter: brightness(1.3);或者backgournd-color: rgba(0, 0, 0, 0.5);
這兩種方式都可以
回答6:<p>//絕對定位 <p>//背景圖 </p> <p>//相對定位 遮罩層 </p> <p>//相對定位 橫向光亮盒子 </p> <p>//相對定位 縱向盒子 </p></p>回答7:
設(shè)計師能解決的盡量不要用css來寫
回答8:醬紫的,用absolute和z-index][1]
相關(guān)文章:
1. Docker for Mac 創(chuàng)建的dnsmasq容器連不上/不工作的問題2. PHP求助,求幫忙謝謝各位3. extra沒有加載出來4. mysql - php 如何網(wǎng)址中出現(xiàn)該頁標題?5. javascript - 天貓首頁首屏數(shù)據(jù)來源6. javascript - 釘釘?shù)膃xcel, word文件預覽是直接用的微軟的office web app,不犯法嗎?7. 關(guān)于Mysql數(shù)據(jù)表行轉(zhuǎn)列8. django進行數(shù)據(jù)庫的查詢9. 求救一下,用新版的phpstudy,數(shù)據(jù)庫過段時間會消失是什么情況?10. mysql - 為什么where條件中or加索引不起作用?
