May I right-align an element by setting margin-left
margin: 0 0 0 auto;
but not float
float: right;
?
I don’t know if this is right but it works, both in Chrome and Safari.
========
A.K’s answer is what I need;
And this is also helpful, via Praveen Kumar:
You can, but the support is limited. It works only in Chrome and Safari. Not even in Firefox, I guess. See, if you are going to target only Chrome browser, yes, you can. All the -webkit- based browsers support this, but not others. Choice is yours. 🙂
Yes, you can right-align an element by setting
margin-left:autoBut see the difference between
marginandfloatresults below:Margin
Float:
SEE RESULT