1

I am trying to achieve masking on image same as below:

Image masking

I tried some of the CSS here:

Codepen Link

using clip-path: using clip-path codepen

What I tried is:

HTML:

<div class="mask-section">
  <div class="content">
    <h1>This is Test</h1>
  </div>
</div>

CSS:

.mask-section {
    background-color: white;
}
.content {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
    border-radius: 0 0 90% 90% / 15em;
  overflow: hidden;
  width: 100%;
  height: 300px;
  background-image: url(https://i.pinimg.com/originals/5e/f6/83/5ef68313994aaf68e87d190de943f104.jpg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.content:before {
  content: '';
  position: absolute;
  background-color: rgba(0,0,0,0.5);
  width: 100%;
  height: 100%;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
}
.content h1 {
  text-align: center;
  text-transform: uppercase;
  color: white;
  z-index: 0;
}

But it doesn't look as expected, it looks like this:

Not look as expected

How can I create the same curved from bottom of the image added? It will be useful if someone can help me on this. I tried similar questions asked here but no luck!

Pathik Vejani
  • 4,263
  • 8
  • 57
  • 98

0 Answers0