CSS Background-Image mit Opacity

Man kann mit einem Trick irgendwo ein Background-Image platzieren und durch CSS-Opacity transparent machen.

.mySection { width: 200px; height: 200px; display: block; position: relative; } .mySection::after { background-image: url('../img/bg.jpg'); content: ""; opacity: 0.2; top: 0; left: 0; bottom: 0; right: 0; position: absolute; z-index: -1; }

Neuen Kommentar schreiben

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

Suche

Neueste Kommentare