英文:
Inline list-style-type with dash
问题
需要编写带有破折号的内联列表样式。
这个有效:
'<ul><li style="list-style-type: '-'"> text </li></ul>'
但我使用XtraReport,那里不起作用。必须在开头和结尾加上引号'
。
我编辑了问题。
英文:
I need to write Inline list-style-type with dash.
this works:
'<ul><li style="list-style-type: '-' "> text </li></ul>'
But I use XtraReport and there it doesnt. There has to be quotation mark ' at the begining and at the end.
I edited the question.
答案1
得分: 1
Use ' for inside the inline, to avoid confusion to closing style property.
Also, close <li>
tag first before closing <ul>
tag.
So, instead of:
<ul><li style="list-style-type: "- ";"> text </ul></li>
use:
<ul><li style="list-style-type: ''-';"> text </li></ul>
英文:
Use ' for inside the inline, to avoid confusion to closing style property.
Also, close <li>
tag first before closing <ul>
tag.
So, instead of:
<ul><li style="list-style-type: "- ";"> text </ul></li>
use:
<ul><li style="list-style-type: '- ';"> text </li></ul>
答案2
得分: 0
- – 项目 1
- – 项目 2
- – 项目 3
"添加了样式属性到<ul>元素,通过设置list-style-type: none来去除默认的项目符号,并添加了一些额外的样式来去除任何默认的填充。
每个列表项<li>具有display: inline属性,使它们呈现为内联,并且设置了list-style-type: none属性来去除任何默认的项目符号。
在每个列表项内,使用了"– HTML实体"来表示破折号字符。"
英文:
<ul style="list-style-type: none; padding: 0;">
<li style="display: inline; list-style-type: none;">
<span>– Item 1</span><br>
</li>
<li style="display: inline; list-style-type: none;">
<span>– Item 2</span><br>
</li>
<li style="display: inline; list-style-type: none;">
<span>– Item 3</span><br>
</li>
</ul>
"<ul style="list-style-type: none; padding: 0;">
<li style="display: inline; list-style-type: none;">
<span>&ndash; Item 1</span><br>
</li>
<li style="display: inline; list-style-type: none;">
<span>&ndash; Item 2</span><br>
</li>
<li style="display: inline; list-style-type: none;">
<span>&ndash; Item 3</span><br>
</li>
</ul>
"
added the style attribute to the <ul> element to remove the default bullet points by setting list-style-type: none and added some additional styling to remove any default padding using padding
Each list item "(<li>)" has the display: inline property to make them appear inline, and the list-style-type:
none property is set to remove any default list-style-type.
Inside each list item, the "&ndash; HTML entity"
is used to represent the dash character.
答案3
得分: 0
Try this code, it is working.
<html>
<head>
<style>
ul.dash-list {
list-style-type: none;
}
ul.dash-list li::before {
content: "-"
margin-right: 5px;
}
</style>
</head>
<body>
<ul class="dash-list">
<li>第一项 </li>
<li>第二项</li>
<li>第三项</li>
</ul>
</body>
</html>
英文:
Try this code, it is working.
<html>
<head>
<style>
ul.dash-list {
list-style-type: none;
}
ul.dash-list li::before {
content: "-";
margin-right: 5px;
}
</style>
</head>
<body>
<ul class="dash-list">
<li>First item </li>
<li>Second item</li>
<li>Third item</li>
</ul>
</body>
</html>
Thanks
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论