gpt4 book ai didi

css - 我的列表没有正确对齐并且不确定如何修复

转载 作者:行者123 更新时间:2023-11-27 23:46:12 25 4
gpt4 key购买 nike

我有一个看起来像这样的列表,我没有将任何 css 放入其中,但它在第二行换行后没有与元素符号对齐...

模板:

            <ul>
<li>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus possimus maxime at repudiandae ut ad hic eaque cum fugiat ipsa odit natus, alias unde debitis explicabo, iste reiciendis dignissimos sequi.
</li>
<li>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus possimus maxime at repudiandae ut ad hic eaque cum fugiat ipsa odit natus, alias unde debitis explicabo, iste reiciendis dignissimos sequi.
</li>
<li>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus possimus maxime at repudiandae ut ad hic eaque cum fugiat ipsa odit natus, alias unde debitis explicabo, iste reiciendis dignissimos sequi.
</li>
</ul>

输出:

enter image description here

我希望每个列表都与元素符号对齐,有没有办法用 css 做到这一点?

最佳答案

使用list-style-position: outset:

li {list-style-position: outset}
<ul>
<li>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus possimus maxime at repudiandae ut ad hic eaque cum fugiat ipsa odit natus, alias unde debitis explicabo, iste reiciendis dignissimos sequi.
</li>
<li>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus possimus maxime at repudiandae ut ad hic eaque cum fugiat ipsa odit natus, alias unde debitis explicabo, iste reiciendis dignissimos sequi.
</li>
<li>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus possimus maxime at repudiandae ut ad hic eaque cum fugiat ipsa odit natus, alias unde debitis explicabo, iste reiciendis dignissimos sequi.
</li>
</ul>

关于css - 我的列表没有正确对齐并且不确定如何修复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56797935/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com