I can't understand the DOM behavior of list element

Why the ordered list DOM structure sometimes is ol > li and sometimes is ol > li > p?

Google Photos

Google Photos

Can someone tell me the exact reason? I'm so confused about it. :face_with_spiral_eyes:

Ok, I finally found that when typing a list as usual, it is ul > li :

- item 1
- item 2
- item 3
- item 4
- item 5

But if I break it up into two, the whole list will become ul > li > p:

- item 1
- item 2
- item 3

- item 4
- item 5

I don't know if it's not a bug, but it made me confused when I've added some CSS styles to it and sometimes disappear.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.