How to remove "padding" from ionic card
Add margin: 0 !important;
and padding: 0 !important;
for your card's css. Like this:
ion-card {
width:100%;
height:300px;
margin: 0 !important;
padding: 0 !important;
}
ion-card > img {
width: 100%;
height: 100%;
}
<ion-card>
<img src="...">
</ion-card>
See 1st you should never assign negative values to padding
as it won't work. If you need to work with negative values then use margin
,
2nd try adding width
and height
of 100%
to your img
.
Just for example -
#parent{
width:500px;
height:300px;
}
#parent > img{
width:100%;
height:100%;
}
<div id="parent">
<img src="https://source.unsplash.com/random">
</div>