How do I get my text to be direction from right to left without using a p tag?

Posted by smfoote on Stack Overflow See other posts from Stack Overflow or by smfoote
Published on 2010-04-30T15:31:35Z Indexed on 2010/05/15 23:30 UTC
Read the original article Hit count: 190

Filed under:
|
|
|

I have a dynamically appearing div on a page. I would like to be able to hide the div with a button at the top right corner of the div. One way I have found to do this is to use a p tag, like so:

<p dir="RTL">button</p>

If this is the first line of HTML within the div, it will put the button in the upper right hand corner of the div. However, it gives me a new line above and a new line below, so, the button isn't really where I want it to be. The "dir" attribute doesn't seem to work with a span tag, and if I display the p tag inline using css

p {
display:inline;
}

the button is no longer right aligned. Instead it stays in the left hand corner. Is there a way to get this button in the upper right hand corner without two unnecessary new lines and without a bunch of  ?

© Stack Overflow or respective owner

Related posts about html

Related posts about right