Make content at the right most in a div tag

Posted by Yongwei Xing on Stack Overflow See other posts from Stack Overflow or by Yongwei Xing
Published on 2010-04-01T02:41:00Z Indexed on 2010/04/01 2:43 UTC
Read the original article Hit count: 323

Filed under:
|

Hi all

I have some html snippet

<div id="title">This is title<span id="close">X<span><div> 

The width of this div is dynamical, maybe 300 600 or 800 px. I want the "X" at the right most of the div at the same line. So write a css like below:

#close
{
   margin-right:10px;
}

But it does not work. If I want to implement it, what should I config?

Best Regards,

© Stack Overflow or respective owner

Related posts about html

Related posts about css