0

Hi everyone,

I just had a quick question.

I have a div that has text in it.

What I want to have is some text in the left and some text in the right so inside the div, the text Hello is displayed on the left as soon as the div starts and then I want the text after that, which "HELLO", to be displayed at the right of the div near the right end.

I tried text-align:right but it didn't work.

Please help me.

I think this is an easy problem but I am not able to solve it.

3
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by Dandello
0

Split your text - put the left-aligned stuff into a left-aligned paragraph (or float it left) and the other stuff in a right-aligned paragraph (or float it right). If you need it in columns - then use two divs inside the main one - float one left and the other right (make sure their widths add up properly) and clear the floats afterward.

0

The HTML span tag is used for grouping and applying styles to inline elements. While you could use span for alignment, alignment properties make more sense on the block level, as in div's and p's

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.