2014-01-30 97 views
18

我需要的是僅使用html和css創建像這樣的跨網站透明水印。不知道如何始終將它保存在一個地方,例如瀏覽器窗口的右下角。使用html和css創建水印

在此先感謝

enter image description here

+0

您應該應用不透明度:.6;例如和位置絕對div。 –

+0

對於水印,您可以使用某些樣式爲div定位,並將其固定在您喜歡的位置。既然你只想要html和css,這可以做到。 –

+0

@srekoble也許jsfiddle? – demonoid

回答

29
#watermark 
{ 
position:fixed; 
bottom:5px; 
right:5px; 
opacity:0.5; 
z-index:99; 
color:white; 
} 

jSFiddle

+0

我需要的東西,即使在滾動時,總是保持相同的地方 – demonoid

+0

^這樣做 - 對不起小提琴didn不會更新。現在就試試。 – ElendilTheTall

3

爲了使固定:嘗試這種方式,

jsFiddleLink:http://jsfiddle.net/PERtY/

<div class="body">This is a sample body This is a sample body 
    This is a sample body 
    This is a sample body 
    This is a sample body 
    This is a sample body 
    This is a sample body 
    This is a sample bodyThis is a sample bodyThis is a sample body 
    This is a sample body 
    This is a sample body 
    This is a sample body 
    This is a sample body 
    This is a sample body 
    This is a sample body 
    This is a sample body 
    v 
    This is a sample body 
    This is a sample body 
    This is a sample body 
    This is a sample body 
    This is a sample body 
    This is a sample body 
    <div class="watermark"> 
      Sample Watermark 
    </div> 
    This is a sample body 
    This is a sample bodyThis is a sample bodyThis is a sample body 
</div> 



.watermark { 
    opacity: 0.5; 
    color: BLACK; 
    position: fixed; 
    top: auto; 
    left: 80%; 
} 

要使用絕對:

.watermark { 
    opacity: 0.5; 
    color: BLACK; 
    position: absolute; 
    bottom: 0; 
    right: 0; 
} 

的jsfiddle:http://jsfiddle.net/6YSXC/

2

你可以使用opacity:0.5;//what ever you wish between 0 and 1這一點。

工作Fiddle

-1

可能這可能是對你有很大的幫助。

div.image 
{ 
width:500px; 
height:250px; 
border:2px solid; 
border-color:#CD853F; 
} 
div.box 
{ 
width:400px; 
height:180px; 
margin:30px 50px; 
background-color:#ffffff; 
border:1px solid; 
border-color:#CD853F; 
opacity:0.6; 
filter:alpha(opacity=60); 
} 
    div.box p 
{ 
margin:30px 40px; 
font-weight:bold; 
color:#CD853F; 
} 

檢查this link一次。