M
M
Michael R.2018-02-01 16:20:12
css
Michael R., 2018-02-01 16:20:12

How to crop the bottom of an image?

Hello!
There are 2 blocks, each of the blocks has a bg image. How to cut the bg of the first block from the bottom so that it looks like what is on the screen?
5a7313c9a3790022469962.png
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Michael R., 2018-02-01
@Mike_Ro

The issue was resolved like this:

.container {
width:100%;
height:100%;
background:grey;
background-position: 0% 50%;
}

<div class="container" >
<svg width="100%" height="100%" viewBox="0 0 400 300" preserveAspectRatio="none" >
  <defs>
    <clipPath id="clip" clipPathUnits="objectBoundingBox">
      <polygon points="0,1 0,0.5  0.5,0.67 1,0.5 1,1"></polygon>
    </clipPath>
  </defs>
  <image xlink:href="http://placeimg.com/400/300/any" clip-path="url(#clip)" width="100%" height="100%" />
</svg>
</div>

M
Maxim Timofeev, 2018-02-01
@webinar

we make a triangle using pseudo elements, or rather borders.
tyts

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question