user6689604 user6689604 - 1 year ago 142
CSS Question

Can't remove padding underneath image ionic

I'm trying to add in an image into ion-content, essentially as a top banner, but there's some pesky padding that's automatically added below it that I just can't seem to remove. The code is:

<img src="" style="width:100%; padding:0px">
<div class="list">
<div class="item item-divider">

This codepen demonstrates what I'm talking about I want to remove the spacing between the bottom of the image and the "Settings" item-divider. Anyone know how? I've tried using padding/margin properties in css to no success.

Answer Source

Apply display: block; to the img tag and see the Magic!


By default, an image is rendered inline, like text. All inline-block elements has some vertical-align value by default- reset it either by applying vertical-align: top or reset the display property by applying display: block

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download