具有不同缩进的项目符号列表

发布于 2024-10-09 15:39:10 字数 282 浏览 0 评论 0原文

我可以在我的网站上制作使用

    的项目符号列表吗?
  • 标签有不同的缩进距离吗?

  • 元素一
  • 元素二
  • and even this line which is not in an <li> tag are indented

  • 不带
      的列表元素标签
  • 没有缩进
  • 我想缩进一些元素,但默认距离太大而 sans-indent 太小。

    Can I make bulleted lists on my site that use <ul> and <li> tags have a different indentation distances?

    • Element One
    • Element Two
    • and even this line
      which is not in an <li> tag are indented

  • List elements without the <ul> tags are
  • not indented
  • I would like to indent some elements, but the default distance is too much and the sans-indent is too little.

    如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

    扫码二维码加入Web技术交流群

    发布评论

    需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

    评论(2

    心意如水 2024-10-16 15:39:10
    <ul style="padding-left:20px">
        <li>Element 1</li>
        <li>Element 2</li>
    </ul>
    

    我认为默认缩进是40px,这使它减半。

    <ul style="padding-left:20px">
        <li>Element 1</li>
        <li>Element 2</li>
    </ul>
    

    I think the default indentation is 40px, this halves it.

    心的憧憬 2024-10-16 15:39:10
    li {
      margin-left: 10px;
    }
    ul li{ 
      margin-left: 20px;
    }
    

    调整两个压痕的稍微干净的方法。边距和内边距有所不同,因此请使用最适合您的方式。

    li {
      margin-left: 10px;
    }
    ul li{ 
      margin-left: 20px;
    }
    

    A slightly cleaner way to adjust both of the indentations. Margin and padding differ, so use whichever suits you best.

    ~没有更多了~
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文