html - how to style on the most right in <li>s? -


cant figure out why code dont work, it's still on left:

<ul style="list-style: none; width: 200px;" > <li class="item" ><p>hello world</p></li> <li class="item"><p>hello world</p></li> <li class="item"><p>hello world</p></li> </ul> 

my css:

.item {  position: relative;   right: 0px;   margin-top: 2px; } 

i tried transferring style of li on p , both still has no effect. help?

just use text-align: right on <ul>:

<ul style="list-style: none; width: 200px; text-align:right" >    <li class="item" ><p>hello world</p></li>    <li class="item"><p>hello world</p></li>    <li class="item"><p>hello world</p></li>  </ul>


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -