Reputation: 363
I always seem to have aligning problems with CSS.
There's many different methods of aligning right, but none of the techniques I usually do work.
I don't want to use margin with % value either.
trying to get this checkmark to align right.
.HTML
<ion-item>
<span>
Every Sunday
</span>
<ion-icon class="right" name="checkmark"></ion-icon>
</ion-item>
.CSS
.right{
float:right;
text-align: right;
}
EDIT: Found it was Ionic feature preventing other CSS aligning it.
So slot="end"
did the trick in the .HTML
Upvotes: 1
Views: 1534
Reputation: 543
You don't need to write css for it. Ionic framework already has solution of this. There exist slot property in Ionic which has start and end value.
you need to put slot="end" on ion-icon.
<ion-item>
<span>
Every Sunday
</span>
<ion-icon slot="end" class="right" name="checkmark"></ion-icon>
</ion-item>
Upvotes: 2
Reputation: 166
i hope i understood your question/intention correctly. try adding the following rules for you ion-item
class:
width: 100%; /* or whatever you want the reference element to be */
display: inline-block;
this will make the element you are aligning on the right (right
) do the same - but the width of the reference element (ion-item
) has changed.
Upvotes: 0