Search
 
SCRIPT & CODE EXAMPLE
 

CSS

How to make in CSS an overlay over an image?

.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);
}
Comment

image overlay in css

background: linear-gradient(0deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.86)), url(your-img-path);
Comment

How to make in CSS an overlay over an image?

.foo {
    background-image: url(images/image1.png), url(images/image2.png);
    background-color: violet;
    background-blend-mode: screen multiply;
}
Comment

image overlay css

<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;
}
Comment

PREVIOUS NEXT
Code Example
Css :: border radius color html 
Css :: bootstrap database table cdn 
Css :: change image color with css 
Css :: remove black shadow from border 
Css :: onclick css animation 
Css :: losange css 
Css :: text-overflow ellipsis hover tooltip css 
Css :: deobfuscate css 
Css :: how to hover div in css 
Css :: *{ margin: 0; padding: 0; box-sizing: border-box; } 
Css :: css color when clicked 
Css :: css nested 
Css :: para que sirve justify-content-center 
Css :: position absolute and relative css 
Css :: adding quotes css 
Css :: download styles.css 
Css :: put a background image in css with absolute layout 
Css :: border style shorthand 
Css :: letter spacing text 
Css :: html textgröße ändern css 
Css :: in 10 seconds fade in a card html css 
Css :: lando expose database port 
Css :: css apply style to direct children 
Css :: How to add a pure css loading spinner 
Css :: html css landing page 
Css :: flexbox css 
Css :: css custom cursor form image 
Css :: min function css 
Css :: css light mode 
Css :: how to boosts your rendering performance 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =