开发者

css problem with make text in the right

开发者 https://www.devze.com 2022-12-24 03:11 出处:网络
i have this <li><a href=\"#\" >title</a> <span style=\'text-align:right;\'>(0)</spa开发者_StackOverflown></li>

i have this

<li><a href="#" >title</a> <span style='text-align:right;'>(0)</spa开发者_StackOverflown></li>

its not working and this

<li><a href="#" >title</a> <span style='float:right;'>(0)</span></li>

its go to the down line (not working)

its appear like that

|title (0)     |

i want it

|title      (0)|


There is likely a more elegant solution to do this but this should work:

<li style="position:relative">
    <a href="#">title</a> <span style="position:absolute; right:0;">(0)</span>
</li>

You may want to add padding-right to the li to account for the space used by the span so that the link text and the span don't overlap.

0

精彩评论

暂无评论...
验证码 换一张
取 消