Example:
<td>
<img src="..." />
<img src="..." />
<div style="text-align:right display:inline;">
hello world!
</div>
</td>
Even though the property says “text” align, it affects all elements inside the block-level element that are either inline or inline-block elements. The property only affects the content inside the element to which it is applied, and not the element itself.
Make sure you set the text-align property for the first list item to "left" (ul li:first-child), and set the text-align property for the other list items (ul li) to "right". That aligns them to the left and to the right but on two suppurate lines.
To set text alignment in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <p> tag, with the CSS property text-align for the center, left and right alignment.
You can use Flexbox instead and set margin-left: auto on inner div to move it to right. Show activity on this post.
Well technically you can but it will have no effect. Display: inline will display the div as an inline element (like an a or span) and therefore not have a width - it will shrink to fit the text.
If you are trying to display inline text on the right try using float: right;
Also, in your code you missed out an ";" after the text-align: right.
You can wrap the element which you want to have display:inline inside another div with dir="rtl"
<div dir="rtl">
<div style="display: inline">Align to the right</div>
</div>
Demo: https://jsfiddle.net/guya/xwhodc0s/
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