Which alignment technique you use depends on your circumstances but the basic one is float: right;:
You’ll probably want to clear your floats though but that can be done with overflow:hidden on the parent container or an explicit
at the bottom of the container.
For example: http://jsfiddle.net/ambiguous/8UvVg/
Floated elements are removed from the normal document flow so they can overflow their parent’s boundary and mess up the parent’s height, the clear:both CSS takes care of that (as does overflow:hidden). Play around with the JSFiddle example I added to see how floating and clearing behave (you’ll want to drop the overflow:hidden first though).
If the button is the only element on the block:
.border {
border: 2px blue dashed;
}
.mr-0 {
margin-right: 0;
}
.ml-auto {
margin-left:auto;
}
.d-block {
display:block;
}
If there are other elements on the block:
.border {
border: 2px indigo dashed;
}
.d-table {
display:table;
}
.d-table-cell {
display:table-cell;
}
.w-100 {
width: 100%;
}
.tar {
text-align: right;
}
The paragraph…..lorem ipsum…etc.
With flex-box:
.flex-box {
display:flex;
justify-content:space-between;
outline: 2px dashed blue;
}
.flex-box-2 {
display:flex;
justify-content: flex-end;
outline: 2px deeppink dashed;
}
Button with Text
Once upon a time in a …
Only Button
Multiple Buttons
Good Luck…