I have a numbered list in a div on the left of the screen. To the right of this div, I have another div with elements that correspond to a numbered list. When the screen is minimized so that the text in the first line turns to the second line, I would like 2 from the numbered list to move to the third line to match the Second Item entry .
I tried a couple of different things (using actual numbered lists, using a single div, etc.) and couldn't make something work. Using a single div makes the most sense, but I want the numbered list to be on a separate line on the left. this can be seen in the linked violin. Any help is appreciated!
- The following shows how it is viewed when it is not wrapped.
1 First Item
2 Second Item
- The following shows how it is viewed at completion.
1 First
2 Item
Second
Item
- The following shows how I would like to view it upon completion.
1 First
Item
2 Second
Item
Here is the code:
<div class="xml-block">
<div id="xml-sidebar">
<p class="xml-number">1</p>
<p class="xml-number">2</p>
</div>
<div id="xml-group">
<p class="xml-symbol xml-list">Position of the first entry.</p>
<p class="xml-symbol xml-list"><span class="xml-text">Position of the second entry.</span></p>
</div>
In the following example, when the window is small enough for the text to wrap, number 2 from the list is not adjusted to remain with the second input.
https://jsfiddle.net/b1Lpeffw/2/
source
share