CSS 不要为 Ordererd 或无序列表显示数字/项目符号
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9709758/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Don't Display Numbers/Bullets for Ordererd or Unordered List
提问by user1048676
All, I'm using the following code to generate some li items in an ol.
所有,我正在使用以下代码在 ol 中生成一些 li 项目。
$output = '<div id="menu_options">';
$output .= '<ol class="tabs">';
foreach($menu_items as $menu){
$output .= '<li><a href="'.$menu->ID.'" class="menu_page_id">'.$menu->title.'</a></li>';
}
$output .= '</ol>';
$output .= '</div>';
$output .= '<div id="menu_content">This is content</div>';
This works fine however I'd like to get rid of the 1., 2. etc. Is there a way to remove these and not display anything where these would typically go?
这工作正常,但是我想摆脱 1., 2. 等。有没有办法删除这些而不显示这些通常会出现的任何内容?
回答by Mr Lister
Yes, use a style property of list-style-type:none
on the ol
, either inline as a style
attribute, or in your stylesheet under the .tabs
class.
是的,使用list-style-type:none
on 的样式属性,ol
作为style
属性内联,或在.tabs
类下的样式表中。