HTML CSS examples for CSS Widget:Image
Add alpha/opacity to background image
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> div {<!-- w ww .ja v a 2 s . co m--> display:block; background:url('http://www.java2s.com/style/demo/Google-Chrome.png') 0 0 no-repeat; background-color:Chartreuse; background-size:cover; height:501px; width:501px } div:before { content:""; position:absolute; width:100%; height:100%; opacity:.5; z-index:2; background-color:yellow; } </style> </head> <body> <div> <h1>Hello, it's me!</h1> </div> </body> </html>