tags:

views:

50

answers:

1

Hi,

i have the old classic code like this

<td align="right">

which does what it says: it right aligns the content in the cell. So if i put 2 buttons in this cell, they will appear at the right site of the cell.

But then i was refactoring this to CSS, but there is no such thing as right align? i see text-align, is that the same?

Michel

+4  A: 

Use

text-align: right

The text-align CSS property describes how inline content like text is aligned in its parent block element. text-align does not control the alignment of block elements itself, only their inline content.

See

text-align

<td class='alnright'>text to be aligned to right</td>

<style>
    .alnright { text-align: right; }
</style>
rahul
is a <input type="button"> a block element because that one doesn't get aligned right?
Michel
what if i want to right align a block element?
Michel