我想创建内联项目列表,用项目符号分隔,但我想隐藏行尾的所有项目符号。例:
法国 • 德国 • 希腊
匈牙利 • 冰岛 • 爱尔兰
(如您所见,希腊和匈牙利之间没有子弹)。
现在,问题是,我需要它在任何视口宽度下工作。文本应自然换行,项目符号应仅在不在换行符处时才显示。
这在某种程度上类似于软连字符(&害羞;)行为。
有什么方法可以做到这一点吗?也许是某种 unicode 控制字符..?
谢谢!
你只需要编写简单的css代码:
.someclass{
list-style:none;
}
在您的中添加类
<ui>
<li class="someclass">
</li>
</ul>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Display Progress</title>
<script src="Scripts/jquery-1.3.2.js"
type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
var geoList = [
{ Country: "India", State: "Delhi" },
{ Country: "US", State: "Alabama" },
{ Country: "US", State: "Georgia" },
{ Country: "US", State: "Texas" },
{ Country: "US", State: "NewYork" }
];
$('#LoadPage').append("<ul id='cList'></ul>");
for (i = 0; i < geoList.length; i++) {
$("#cList").append("<li>" +
geoList[i].Country + "-" +
geoList[i].State + "</li>");
}
});
</script>
</head>
<body>
<form id="form1">
<div>
<div id="LoadPage">
</div>
</div>
</form>
</body>
</html>