2013-01-10 53 views

回答

10

這只是一個微小的,半透明的背景下,被平鋪在背景圖像的圖像:

http://www.uiueux.com/wp/flowfolio/wp-content/themes/flowfolio/img/bg_mask.png

您只需要創建一個元素,舒展它在你的背景:

#dots { 
    position: absolute; 

    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 

    background-image: url('dots.png'); 
    z-index: 1; 
} 

確保元素的z-index高於背景的z-index d,但低於內容的z-index。這樣,它不會掩蓋你的文字。

+0

OP,確保你有正確的z-index。 – Jonathan

+0

哇,它像1像素大聲笑 – jackcogdill

3

該網站使用具有透明背景的div。所以它是頁面上的一個背景,而另一個背景正在重複。

<div class="back_mask"></div> 

.back_mask { 
    z-index: -990; 
    position: fixed; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background: url(img/bg_mask.png); 
} 
+0

+1使用實際頁面的來源 – Cameron

3

其他人打敗了我,但它只是一個位於其他圖像上的圖像。

這裏是我的影像解決方案

HTML

<div class="dots"> 
    <img src="http://placekitten.com/300/300" /> 
</div> 

CSS

.dots { 
    position: relative; 
    display: inline-block; 
} 
.dots:after { 
    content: ""; 
    display: block; 
    position: absolute; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background: url(http://www.uiueux.com/wp/flowfolio/wp-content/themes/flowfolio/img/bg_mask.png); 
} 

要以對角線這樣做只是改變形象是一個對角線,可以平鋪