Get multi-line text to align with content instead of a numeric label using OL and type list-style: inside

I have an OL element with a position-list: inside. However, if the text inside the LI element is multi-line, the text of the next line is cleared of numbering, and not with other text.

Is there any way to fix this?

Used code:

<style type="text/css">
ol { list-style-position: inside; }
</style>

<ol>
<li>If this text passes to the next line, it not aligned with the content but with
the numeric label.
</ol>

Thank you for your help:)

+3
source share
3 answers

Well, just delete list-style-position: inside;(:
you need list-style-position: outside;, which is the default value.
If you really need to list-style-position: inside;, you can try installing paddingand text-indentin the ol element: http://jsfiddle.net/KXdjZ/4/

+4

.

ol {
    list-style-position: outside;
    margin-right: -20px
}

, , .

+1
list-style-position: outside;

If I understand well ...

+1
source

Source: https://habr.com/ru/post/1767138/


All Articles