你好这可能是一个简单的修复。所以我有一些<ul>
,每个{15} <li>
..
我的一些HTML。
<ul>
<li><span>Government Gazette, No. 32320 of 12 June 2009. Forestry Sector Charter. s.l.:s.n.</span></li>
<li><span>Government Gazette, No. 34267 of 10 May 2011. Charted Accountancy Sector Charter. s.l.:s.n.</li>
<li><span>Government Gazette, No. 35400 of 1 June 2012. Property Sector Charter. s.l.:s.n.</li>
<li><span>Government Gazette, No. 35423 of 06 June 2012. Information Technology and Telecommunication Sector Charter. s.l.:s.n.</span></li>
<li><span>Government Gazette, No. 35754 of 5 October 2012. Revised Broad-Based Black Economic Empowerment Codes of Good Practice and B-BBEE Technical Assitance Guideline. s.l.:s.n.</span></li>
<li><span>Government Gazette, No. 35907 of 23 November 2012. Broad-Based Black Economic Empowerment Amendment Bill. s.l.:s.n.</li>
<li><span>Government Gazette, No. 35914 of 26 November 2012. Financial Services Sector Charter. s.l.:s.n.</span></li>
<li><span>Government Gazette, No. 53 of 2003. Broad-Based Black Economic Empowerment Act. s.l.:s.n.</span></li>
</ul>
我不得不缩短它。
我的css:
#bee_wwwh_box ul{
list-style-type:upper-roman;
margin-bottom: 10px;
margin-top: 15px;
margin-left: 30px;
margin-right: 450px;
}
#wwwh_box li{
font-size: 18px;
color: #16a6b6;
letter-spacing: 1px;
margin-bottom: 10px;
margin-top: 15px;
margin-left: 30px;
margin-right: 30px;
}
#wwwh_box li span {
color: #41413e;
}
因为你可以看到我已经将所有文字都包裹在<span>
中,然后尝试改变罗马符号的颜色,以便人们可以清楚地看到有一个项目列表的位置。只是它改变整个列表文本??我不能做它的正面或反面?
答案 0 :(得分:2)
它有效,你遗漏了一些结束<span>
标签
HTML:
<div id="wwwh_box">
<ul>
<li><span>Government Gazette, No. 32320 of 12 June 2009. Forestry Sector Charter. s.l.:s.n.</span></li>
<li><span>Government Gazette, No. 34267 of 10 May 2011. Charted Accountancy Sector Charter. s.l.:s.n.</span></li>
<li><span>Government Gazette, No. 35400 of 1 June 2012. Property Sector Charter. s.l.:s.n.</span></li>
<li><span>Government Gazette, No. 35423 of 06 June 2012. Information Technology and Telecommunication Sector Charter. s.l.:s.n.</span></li>
<li><span>Government Gazette, No. 35754 of 5 October 2012. Revised Broad-Based Black Economic Empowerment Codes of Good Practice and B-BBEE Technical Assitance Guideline. s.l.:s.n.</span></li>
<li><span>Government Gazette, No. 35907 of 23 November 2012. Broad-Based Black Economic Empowerment Amendment Bill. s.l.:s.n.</span></li>
<li><span>Government Gazette, No. 35914 of 26 November 2012. Financial Services Sector Charter. s.l.:s.n.</span></li>
<li><span>Government Gazette, No. 53 of 2003. Broad-Based Black Economic Empowerment Act. s.l.:s.n.</span></li>
</ul>
</div>
CSS:
#bee_wwwh_box ul {
margin-bottom: 10px;
margin-top: 15px;
margin-left: 30px;
margin-right: 450px;
}
#wwwh_box li {
list-style-type:upper-roman;
font-size: 18px;
color: #16a6b6;
letter-spacing: 1px;
margin-bottom: 10px;
margin-top: 15px;
margin-left: 30px;
margin-right: 30px;
}
#wwwh_box li span {
color: #41413e;
}
答案 1 :(得分:1)
您对某些元素没有封闭</span>
。你已打开它们并没有关闭它们。这可能是一个问题...
答案 2 :(得分:1)
我认为是因为您的某些SPAN标记尚未关闭? 你有开放标签,但没有关闭标签。
答案 3 :(得分:1)
首先,您的<span>
代码未关闭。
如果这不能解决您的问题,您可以尝试其他一些方法。 一种选择是使用图像代替列表项目符号(参见'list-item-image'):
li { list-style-image: url(images/yourimage.jpg); }
另一种可能性是使用li:before
选择器,但这不适用于旧版本的IE。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
li {
list-style: none;
}
li:before {
/* For a round bullet */
content:'\2022';
/* For a square bullet */
/*content:'\25A0';*/
display: block;
position: relative;
max-width: 0px;
max-height: 0px;
left: -10px;
top: -0px;
color: green;
font-size: 20px;
}
</style>
</head>
<body>
<ul>
<li>foo</li>
<li>bar</li>
</ul>
</body>
</html>
有关这两种方法的详细信息,请参阅this question。