html ul style css for bullet



我遵循了代码。
但是在类"listStyle"中没有ul的样式。

.listStyle {
    color: red;
} 
.listStyle p {
    color: black;
}
ul li{list-style-type:none;}
.liststyle ul, .liststyle li{list-style-type:circle;list-style:circle;display:inline;}
<ul class="listStyle">
    <li>
        <p><strong>View :</strong> blah blah.</p>
    </li>
    <li>
        <p><strong>View :</strong> blah blah.</p>
    </li>
</ul>

我想为具有类"listStyle"的ul设置圆形样式。
其余的必须没有风格。
我必须解决什么问题?
谢谢

代码中有两个小错误:

  1. HTML 和 CSS 中的大写和小写必须相同
  2. 如果你的<ul>有一个像<ul class="list-style">这样的类,那么CSS是ul.list-style

.listStyle {
    color: red;
} 
.listStyle p {
    color: black;
}
ul li {
  list-style-type:none;
}
ul.listStyle li {
  list-style-type: disc;
}
<ul class="listStyle">
    <li>
        <p><strong>View :</strong> blah blah.</p>
    </li>
    <li>
        <p><strong>View :</strong> blah blah.</p>
    </li>
</ul>
<ul>
  <li>list with no bullets</li>
  <li>list with no bullets</li>
  <li>list with no bullets</li>
  <li>list with no bullets</li>
</ul>

如果你写list-style-type: none你就是在拒绝子弹。删除它,它可以工作。

编辑

您可以重置类名的列表样式类型。 请参阅编辑的代码段。并不是说CSS区分大小写。 liststyle !== listStyle

.listStyle {
    color: red;
} 
.listStyle p {
    color: black;
}
 ul li{list-style-type:none;}
.listStyle, .listStyle li { list-style-type: circle; }
<ul class="listStyle">
    <li>
        <p><strong>View :</strong> blah blah.</p>
    </li>
    <li>
        <p><strong>View :</strong> blah blah.</p>
    </li>
</ul>

.listStyle {
    color: red;
} 
.listStyle p {
    color: black;
}
.nostyle{list-style:none;}
.liststyle ul, .liststyle li{list-style-type:circle;}
<ul class="listStyle">
    <li>
        <p><strong>View :</strong> blah blah.</p>
    </li>
    <li class="nostyle">
        <p><strong>View :</strong> blah blah.</p>
    </li>
</ul>

伊茨工作... 如果您不想要列表样式,则表示列表样式:无

最新更新