I'm trying to align text to the right in a small area. It becomes left align when the container is small. Is there anyway to force it right align?
div
{ float: right;
width: 100px;
height: 50px;
text-align: right;
border: thin solid black;
}
https://jsfiddle.net/a362zr54/
If you add direction: rtl;
it will do that
div {
float: right;
width: 100px;
height: 50px;
text-align: right;
border: thin solid black;
direction: rtl;
}
<div>
1testtesttesttesttesttesttesttesttest2
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With