Can I use the display: built-in with text alignment: right?

Example:

<td>
  <img src="..." />
  <img src="..." />
  <div style="text-align:right display:inline;">
    hello world!
  </div>
</td>
+5
source share
2 answers

Well, technically you can, but it will not have any effect. Display: inline displays the div as an inline element (e.g. a or span) and therefore has no 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 the ";" after text alignment: on the right.

+14
source

, . text-align , ( ). , <p> ( ) .

0

All Articles