About Background Image Position On The Right Side

If you want to adjust a non-repeated background image position aligned to the right, you can do this with calc() function like this:

1
2
3
4
5
6
.loading {
    background-image: url(loading.gif);
    background-repeat: no-repeat;
    background-size: 20px 20px;
    background-position: calc(100% - 10px) center;
}

That is analogous to:

1
2
3
4
5
6
.loading {
    background-image: url(loading.gif);
    background-repeat: no-repeat;
    background-size: 20px 20px;
    background-position: right 10px center;
}

Tips and Tricks Web Design CSS3