-1

I have this code:

<div class="item">
    <div class="item-title Traffic">کاردستی</div>
        <div class="item-content">
            <a href=""><img src="images/kardasti.png" width="100%" ></a>
        </div>
    </div>
</div>

and the result is:

enter image description here

Why is this blue area showing below the image?

Paul Roub
  • 36,322
  • 27
  • 84
  • 93

1 Answers1

1

It's because images are intrinsically set to display: inline, so they render similarly to text. Text has line-height that extends above and below the letters, so if there is a background-color, it fills that line-height.

Set your image to display: block in order to nullify the line-height.

Ragdoll
  • 335
  • 1
  • 8