2015-05-14 139 views
0

我想从存储的图像中创建水印。div中的水印背景图像

但水印效果上层,按比例缩小和所有div的颜色..

<div style="background:url({{blogthreadlist.blogUri}}) no-repeat;background-position:center;opacity:0.6;filter:alpha(opacity=60);z-index: -1"> 
    <div class="col-md-12">Something else</div> 
    <div class="col-md-12">Something more..</div> 
    <div class="col-md-12">Something at the end</div> 
</div> 

进出口使用的引导和角度..

如何在水印在一个div创建,并把它放在背景上。但顶部的div(图层)是由不透明度影响的nok:0.6和filter:alpha(opacity = 60)??

+0

什么是你试图去水印...图像或别的东西。 –

回答

6

HTML

<div class="watermark"> 
    <div class="col-md-12">Something else</div> 
    <div class="col-md-12">Something more..</div> 
    <div class="col-md-12">Something at the end</div> 
</div> 

CSS

.watermark { 
    width: 300px; 
    height: 100px; 
    display: block; 
    position: relative; 
} 

.watermark::after { 
    content: ""; 
background:url(https://www.google.co.in/images/srpr/logo11w.png); 
    opacity: 0.2; 
    top: 0; 
    left: 0; 
    bottom: 0; 
    right: 0; 
    position: absolute; 
    z-index: -1; 
} 

Demo

+0

检查https://jsfiddle.net/yg0xgm9t/1/ – Vicky

+0

我有一个角度ng重复显示不同的背景图像。如何使用您的解决方案获得此附加信息? –

+0

https://jsfiddle.net/yg0xgm9t/4/查看此演示,只需要更改背景图像url inline。 – Vicky

-1

试试这个Demo

<div class="wrapper"> 
<div class="watermark"></div> 
    <div class="inner-container"> 
     <div class="col-md-12">Something else</div> 
     <div class="col-md-12">Something more..</div> 
     <div class="col-md-12">Something at the end</div> 
    </div> 
</div> 
+0

你的演示不工作!请修复此问题! – Emily