Alinear el elemento de la lista a la izquierda en una lista desordenada

I have the following html and css:

HTML:

<div id="wrapper">
  <ul>
    <li>li1</li>
    <li>li2</li>
  </ul>
</div>

CSS:

#wrapper
{
}

#wrapper ul
{
    width:50px;
    height:100px;
    border-style:solid;
    border-width:1px;
    list-style-type:none;
}

#wrapper ul li
{
    border-style:solid;
    border-width:1px;   
}

Which results in the following unordered list:

How do I align the list-items to the left in the unordered list?

I've tried float and margin in the "#wrapper ul li", but that doesn't solve the problem..

preguntado el 02 de febrero de 12 a las 11:02

You need to provide more code. jsfiddle.net/cYZtA is what you have given, which does not correspond to the result you have provided. -

What is the css style for your wrapper div? -

Css style for wrapper div now included in question -

Try #wrapper ul { margin: 0px .... } -

margin: 0px didn't solve it :-/ -

3 Respuestas

Agrega una padding-left: 0pt de las personas acusadas injustamente llamadas #wrapper ul bloque:

#wrapper ul
{
    width:50px;
    height:100px;
    border-style:solid;
    border-width:1px;
    list-style-type:none;
    ' CHECK THE NEXT LINE '
    padding-left: 0pt;
}

Respondido 02 Feb 12, 15:02

Your unordered list markers need to be put afuera:

#wrapper ul {
    list-style-type: none;
    list-style-position: outside;
}

Respondido 02 Feb 12, 15:02

Try to decrease padding-left of your UL element. If it won't help, play with padding-left and margin-left of UL and LI.

Respondido 02 Feb 12, 15:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.