Posted inUncategorized

Overlay to an image

How to create overlay to an image

Overlay Images – You can create an overlay over an image using this simple CSS code.

img:before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,255,255, 0.5); /* color you want, in this case, probably black */
    -moz-transition: background .3s linear;
    -webkit-transition: background .3s linear;
    -o-transition: background .3s linear;
    transition: background .3s linear;
}

Leave a Reply