如何在<li>之间移动文本

时间:2018-02-18 18:22:56

标签: html list

当我在两个Text之间插入一些list items时,Textlist items文字对齐,因此看起来好像它是前面list item的一部分。

如何在两个Text之间插入list items以与list items项目符号对齐,或者更好的是,位。

这是关于普通html的最简单的。 (我真的是LaTeX的用户 - 我知道该怎么做!)

这是一张图片:

enter image description here

2 个答案:

答案 0 :(得分:1)

您需要的是定义两个列表,并在它们之间插入您想要的文本。

<ul>
<li>item1 from list1</li>
</ul>
Between two lists
<ul>
<li>item1 from list2</li>
</ul>

答案 1 :(得分:1)

如果在HTML中的两个列表项之间插入文本,则会生成无效的HTML。但更糟糕的是,你会听到时间的风格,因为在CSS中没有明确的方式来定位内容

无效

import sys, time, threading

def spin_cursor():
    while True:
        for cursor in '|/-\\':
            sys.stdout.write(cursor)
            sys.stdout.flush()
            time.sleep(0.1) # adjust this to change the speed
            sys.stdout.write('\b')
            if done:
                return

# start the spinner in a separate thread
done = False
spin_thread = threading.Thread(target=spin_cursor)
spin_thread.start()

# do some more work in the main thread, or just sleep:
time.sleep(10)

# tell the spinner to stop, and wait for it to do so;
# this will clear the last cursor before the program moves on
done = True
spin_thread.join()

# continue with other tasks
sys.stdout.write("all done\n")

解决方案

但是,您可以创建2个单独的列表,并在其间使用您想要的任何HTML。您还可以在列表项中使用段落,甚至可以在列表项内嵌入列表。

&#13;
&#13;
<ul>
    <li>Item 1</li>
    Some other text
    <li>Item 2</li>
</ul>
&#13;
&#13;
&#13;