居中< UL> +保持< LI>的对齐 [英] Centering <UL> + Keeping <LI>'s Aligned

查看:127
本文介绍了居中< UL> +保持< LI>的对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题:
http://i56.tinypic.com/ff3jmo.png



项目符号不会对齐。



我要去的是文本对齐:集中ul所在的班级。我可以调整项目符号吗?



编辑:嘿,大家,只是想澄清一下。我希望实际的项目符合点。目前文字是对齐的,但不是要点。


  • T ext

    • T ext

      • T ext





    我想要的地方


    • 文字

    • 文字

    • 文字

    • (以点对齐,以文字居中)

    解决方案

    text-align:center 不能用于此目的。您应该将< ul> 放置在< div> 以及中心设置为特定宽度并使用 margin-left:auto; margin-right:auto



    因此:

     < div style =width:25% ; margin-left:auto; margin-right:auto;> 
    < ul>
    < li>列表项目1< / li>
    < li>列表项目2< / li>
    < / ul>
    < / div>


    My problem: http://i56.tinypic.com/ff3jmo.png

    The bullet points aren't aligned.

    All I'm going is text-align:center'ing the class in which the ul resides. Can I align the bullet points?

    EDIT: Hey guys, just want to try and clarify. I want the actual bullet points aligned. Currently the text is aligned, but not the bullet points.

    • T e x t
      • T e x t
        • T e x t

    Where as I want

    • Text
    • Text
    • Text
    • (Bullet points aligned, text centered)

    解决方案

    text-align: center isn't to be used for this purpose. You should probably put the <ul> in a <div> and center that by setting it to a certain width and using margin-left: auto; and margin-right: auto.

    So:

    <div style="width: 25%; margin-left: auto; margin-right: auto;">
        <ul>
            <li>List item 1</li>
            <li>List item 2</li>
        </ul>
    </div>
    

    这篇关于居中&lt; UL&gt; +保持&lt; LI&gt;的对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆