D
D
Denis Denisov2019-05-29 15:33:18
HTML
Denis Denisov, 2019-05-29 15:33:18

Why doesn't the image fit perfectly into the block?

There is a div with an image inside, but it is cut off from the bottom, why? (red border is div, blue border is image)
5cee7ada42979536990280.png

<div class="entry__content">
    <a class="entry__content_link" href="#"></a>
    <figure>
        <div class="image-wrapper">
            <img src="https://leonardo.osnova.io/a65226b7-44ae-1315-3b39-b33412f21177/" alt="">
        </div>
        <figcaption class="image-caption">
            <span class="image-caption__title"></span>
            <span class="image-caption__author"></span>
         </figcaption>
    </figure>
    <h2></h2>
    <p></p>
</div>

.entry__content {
  font-size: 18px;
  line-height: 1.6em;
  overflow-wrap: break-word;
  word-wrap: break-word;
  position: relative;

  .entry__content_link {
    position: absolute;
    z-index: 1;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
  }

  h2 {
    margin-bottom: 6px;
  }

  figure {
    margin: 0;
  }

  figcaption {
    font-size: 15px;
    line-height: 22px;
    margin-top: 7.25px;
  }

  .image-wrapper {
    position: relative;
    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid red;

    img {
      border: 1px solid blue;
      width: 100%;
    }
  }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene Chefranov, 2019-05-29
@StupidNick

reset the line-height

.image-wrapper {
line-height: 0;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question