tags:

views:

20

answers:

2

Example:

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

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.

dannybolabo
A: 

The spec is somewhat unclear on this, but it shouldn't work. The text-align property doesn't really make sense on inline elements, since it applies to blocks of text (which inline elements are not). In your example, <p> (a block element) would be a better choice anyway.

You