jbmzhg
Last Updated: February 25, 2016
·
8.708K
· simek
Winterav

CSS3: Transparent background image using ":after"

Simple example:

.any-tag {
    width: 100px;
    height: 100px;
    display: block;
    position: relative;
}

.any-tag:after {
    width: 100px;
    height: 100px;
    top: 0;
    left: 0;
    position: absolute;
    z-index: -1;
    content: "";
    background: url(url-to-your-image);
    opacity: .5;
}

Codepen Demo: http://codepen.io/Simek/pen/JfaKr

Say Thanks
Respond

1 Response
Add your response

12235
E635cf7930e15eb70df724e3cb5e9794 normal

great job
vietnamradio.info

over 1 year ago ·