我想在离子标签的右侧放置彩色的whats-app图片,但我不知道该怎么做。 这是我的代码:
<ion-row>
<ion-col size="10">
<ion-label position="floating">Contato 1* </ion-label>
</ion-col>
<ion-col size="2">
<ion-img class="whatsapp"></ion-img>
</ion-col>
</ion-row>
CSS:
.whatsapp {
height: 20px;
width: 20px;
background-image: url("../../assets/whatsapp.png");
background-repeat: no-repeat;
background-size: 100%;
background-position: bottom left;
}
PS:使用ion-img [src]="assets/whatsapp" /ion-img
无效!
我做了@Carlos Del Cura Pascual告诉我的事情,现在我明白了。差不多了。
答案 0 :(得分:0)
尝试使用flexbox内联对齐项目。 →https://css-tricks.com/snippets/css/a-guide-to-flexbox/
避免使用float或类似的
ion-row{
display:flex;
flex-direction:row;
justify-content:space-around;
align-items:center;
height: /* necessary to give a height to align vertically */
}