In margin the last one is for left in this case, and therefore in this situation it is given as auto.So it should be at its extreme right. But its not happening. I want to know the logic behind this.
.follow-btn {
margin: 0 0 0 auto ;
}
<div class="follow-btn">
<button>Follow</button>
</div>
You’re applying the margin to a div, which fills the entire width of the page by default. So, to make sure the
automargin on the left side pushes it to the right, you could give a specified width, so it actually floats to the right.So that changes your example:
To this: