Steve Forest
Steve Forest

Reputation: 97

Numbers position in <ol> with image only within it

How can I position the numbers of an ordered list when the only element within it is an image.

Exemple : https://i.sstatic.net/zyeWc.jpg

I would like to have to numbers at the top.

Thanks.

Code :

<ol>
        <li class="a1-q1"><img src="../musee_recherche/mediums/00123.jpg" alt="" width="418" height="220" />
        </li>
        <li class="a1-q2"><img src="../musee_recherche/mediums/00123.jpg" alt="" width="418" height="220" />
        </li>
        <li class="a1-q3"><img src="../musee_recherche/mediums/00123.jpg" alt="" width="418" height="220" />
        </li>
        <li class="a1-q4"><img src="../musee_recherche/mediums/00123.jpg" alt="" width="418" height="220" />
        </li>
        <li class="a1-q5"><img src="../musee_recherche/mediums/00123.jpg" alt="" width="418" height="220" />
        </li>
        <li class="a1-q6"><img src="../musee_recherche/mediums/00123.jpg" alt="" width="418" height="220" />
        </li>
    </ol>

    ol {
list-style-type:decimal;
list-style-position:inside;
margin:10px 0 5px 20px;
padding:0;}

ol li {
font-size:12px;
line-height:18px;
margin:0;
padding:0;
color: #000000;}

Upvotes: 2

Views: 1230

Answers (1)

Doug
Doug

Reputation: 2610

ol img {
   vertical-align: top;
}

Example

Upvotes: 4

Related Questions