是否可以设置 ion-img class 的样式?
Is it possible to style the ion-img class?
我尝试在 Scss 中使用 class 在图像中包含高度和宽度,但发现没有任何反应。是否只能内联更改高度或宽度?
HTML
<div class="footer">
<ion-img src="../../../assets/imgs/logo.png"
alt="Logo"></ion-img>
</div>
</ion-footer>
CSS
.footer {
ion-img {
width:40px;
height:40px;
}
}
你需要刺穿影子Dom。
.footer {
::ng-deep ion-img {
width:40px!important;
height:40px!important;
}
}
我尝试在 Scss 中使用 class 在图像中包含高度和宽度,但发现没有任何反应。是否只能内联更改高度或宽度?
HTML
<div class="footer">
<ion-img src="../../../assets/imgs/logo.png"
alt="Logo"></ion-img>
</div>
</ion-footer>
CSS
.footer {
ion-img {
width:40px;
height:40px;
}
}
你需要刺穿影子Dom。
.footer {
::ng-deep ion-img {
width:40px!important;
height:40px!important;
}
}