html - Set page background image opacity -



html - Set page background image opacity -

how set background image entire page opacity 0.4 ?

i tried

html { background: url(img01.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; opacity: 0.4; filter: alpha(opacity=40); /* ie8 , before */ }

but set element's on page opacity , want opacity of img01.jpg ??

without changing image, way it.

using pseudo element positioned fixed or absolute:

html:after { content : ""; display: block; position: fixed; top: 0; left: 0; background-image: url(http://dummyimage.com/1000x1000/000/fff.png); width: 100%; height: 100%; opacity : 0.2; z-index: -1; }

you can see jsfiddle sample.

html css opacity

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -