Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 在李的旁边有一个形状_Css_Alignment_Html Lists - Fatal编程技术网

Css 在李的旁边有一个形状

Css 在李的旁边有一个形状,css,alignment,html-lists,Css,Alignment,Html Lists,有人能告诉我如何让ul li的形状与li对齐吗。 我有一个浮动到左侧的部分,文本位于浮动部分的中心。 我添加了一个ul,但是正方形在页面的一侧,而不是在li项目旁边。 听起来很简单 styleSheet.css #SectionOne { float: left; width: 40%; } #SectionOne ul { list-style-type: square; } #subPage { display: block; margin-right

有人能告诉我如何让ul li的形状与li对齐吗。 我有一个浮动到左侧的部分,文本位于浮动部分的中心。 我添加了一个ul,但是正方形在页面的一侧,而不是在li项目旁边。 听起来很简单

styleSheet.css

#SectionOne {
    float: left;
    width: 40%;
}
#SectionOne ul {
    list-style-type: square;
}
#subPage {
    display: block;
    margin-right: auto;
    margin-left: auto;
}
subPage.php

<body id="subPage">
<section id="SectionOne">
    <h4><b> January 1st 2015</b>
    </h4>
    <p>Related Title</p>
    item1<br>
    item2<br>
    item3<br>
    <p><h3>List Title</h3>
        <ul>
            <li>Bullet Item One</li>
            <li>Bullet Item Two</li>
            <li>Bullet Item Three</li>
        </ul>
    </p>

</section> 
</section>
</body>

“SectionOne”部分向左浮动并居中对齐是我希望的,但是当我将样式添加到“ul”时,项目符号是左对齐的。有没有办法让它们靠近行项目?或者我应该单独为“ul”创建另一个部分吗?

您能进一步澄清您的问题吗?有几种方法可以解释您目前提出的问题。在提出问题时,展示相关代码是非常重要的。