我使用的插圖陰影父頭元素CSS陰影適用於兒童的背景圖片
-webkit-box-shadow:inset 0px 0px 50px 10px #e5e5e55; box-shadow:inset 0px 0px 50px 10px #e5e5e5;
這已經很好地工作了父元素。不過,我有一個背景圖像爲JPG的子元素「徽標」。陰影應用於圖像的頂部。它的奇怪,因爲它不應該適用,但如果它,我會懷疑它完全適用,它看起來像它已被蘸到部分影子!下圖強調了正確的陰影(紫色線條)和錯誤的陰影(紅線)。
在這個截屏中的圖像是一個透明的PNG
我已經試過的Chrome,Firefox和IE瀏覽器都具有的問題。我知道這張照片有點難以看到,但它確實使它看起來沒有定義。我也嘗試將圖像放置在元素中,而不是背景圖像,以及嘗試JPG和PNG文件,但都具有相同的結果。爲頭
<div id="header">
<div id="header-level-1">
<div id="header-logo">
<img src="images/logo.png">
</div>
<div id="header-contact">
<p class="header-contact-title">For More Information Call</p>
<p class="header-contact-phone"><a href="tel:xxx">xxx</a></p>
</div>
</div>
<div id="header-level-2">
<div id="header-nav">
</div>
</div>
</div>
全CSS
注意的圖像是當前在元件相對於背景圖像,但同樣的結果無論哪種方式
HTML完整代碼
#header {width:950px; height:220px; margin:0 auto; margin-top:30px; background-color:#fff; border-radius:15px; -webkit-box-shadow:inset 0px 0px 50px 10px #e5e5e55; box-shadow:inset 0px 0px 50px 10px #e5e5e5;} #header-level-1 {width:950px;} #header-level-2 {width:950px;} #header-logo {width:700px; height:130px; display:inline-block; vertical-align:top;} #header-contact {width:240px; height:100px; padding-top:30px; color:#76a410; font-size:1.3em; display:inline-block; vertical-align:top;} #header-contact a:link {color:#00446e; text-decoration:none; font-weight:900; font-size:1.6em;} #header-contact a:hover {text-decoration:underline; font-weight:800;} .header-contact-title {display:block; padding:0px; margin:0px;} .header-contact-phone {display:block; padding:0px; margin:0px; padding-top:5px;} #header-nav {width:900px; margin-left:25px; height:66px; margin:0 auto; text-align:center; bottom:5px; position:relative; background:url('../images/nav-background.jpg'); border-radius:5px;} #header-nav a:link, #header-nav a:visited, #header-nav a:active {color:#fff; text-decoration:none; padding-left:6px; padding-right:6px; padding-top:18px; display:inline-block;}
六個打開的'div'標籤,只有五個關閉 – Sugar 2013-02-11 12:25:58
對不起,這只是複製和粘貼錯誤 – 2013-02-11 12:26:30
是啊糖是正確的......這不是你正在談論它的影子,因爲它的JPG圖像..只是將您的圖像轉換爲PNG(透明)來糾正它。 – Kingk 2013-02-11 13:28:32