.bg-img{
text-align: center;
padding: 130px 0px;
width: 100% !important;
background-size: cover !important;
background-repeat: no-repeat !important;
background: linear-gradient(0deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.86)), url(your-img-path);
}
background: linear-gradient(0deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.86)), url(your-img-path);
.foo {
background-image: url(images/image1.png), url(images/image2.png);
background-color: violet;
background-blend-mode: screen multiply;
}
<figure class="hover-img">
<img src="yours"/>
<figcaption>
<h3>Lorem <br/>Ipsum</h3>
</figcaption>
</figure>
.hover-img {
background-color: #000;
color: #fff;
display: inline-block;
margin: 8px;
max-width: 320px;
min-width: 240px;
overflow: hidden;
position: relative;
text-align: center;
width: 100%;
}
.hover-img * {
box-sizing: border-box;
transition: all 0.45s ease;
}
.hover-img:before,
.hover-img:after {
background-color: rgba(0, 0, 0, 0.5);
border-top: 32px solid rgba(0, 0, 0, 0.5);
border-bottom: 32px solid rgba(0, 0, 0, 0.5);
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
content: '';
transition: all 0.3s ease;
z-index: 1;
opacity: 0;
transform: scaleY(2);
}
.hover-img img {
vertical-align: top;
max-width: 100%;
backface-visibility: hidden;
}
.hover-img figcaption {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
align-items: center;
z-index: 1;
display: flex;
flex-direction: column;
justify-content: center;
line-height: 1.1em;
opacity: 0;
z-index: 2;
transition-delay: 0.1s;
font-size: 24px;
font-family: sans-serif;
font-weight: 400;
letter-spacing: 1px;
text-transform: uppercase;
}
.hover-img:hover:before,
.hover-img:hover:after {
transform: scale(1);
opacity: 1;
}
.hover-img:hover > img {
opacity: 0.7;
}
.hover-img:hover figcaption {
opacity: 1;
}
Code Example |
---|
Css :: gray scale css |
Css :: box-shadow in css |
Css :: outline bottom css |
Css :: css button pressed effect |
Css :: background-size |
Css :: css grid properties |
Css :: select third element of an id css |
Css :: input type file placeholder |
Css :: link active css |
Css :: line sharpness css |
Css :: pure css tabs |
Css :: css font family |
Css :: css %-px |
Css :: rotate animation css |
Css :: internal style |
Css :: rgb blue color code |
Css :: CSS blue bottom right Box shadow |
Css :: background blur css |
Css :: how to make a square image round css |
Css :: inline pseudo element |
Css :: zero two hair color code |
Css :: refresh css on page |
Css :: css hover affect other item |
Css :: ubuntu uninstall unity hub |
Css :: css animated background |
Css :: padding css shorthand |
Css :: input background color |
Css :: Text that shows an underline on hover |
Css :: sass loader |
Css :: css active |