33

All, I'm using the following code to generate some li items in an ol.

$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?

user1048676
  • 9,756
  • 26
  • 83
  • 120
  • 15
    @PatrikAlienus: This is the first result on Google now. SO is a place to ask questions and get answers. If you find this question elsewhere on SO, mark it as a duplicate. – Josh Noe Nov 16 '14 at 17:10
  • 1
    @PatrikAlienus Indeed. Which is how I found this answer. – Martin Dawson Apr 18 '17 at 09:34
  • 3
    Possible duplicate of [Need an unordered list without any bullets](https://stackoverflow.com/questions/1027354/need-an-unordered-list-without-any-bullets) – mab Jun 19 '17 at 13:17

2 Answers2

73

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.

See http://www.w3.org/TR/CSS21/generate.html#lists

Mr Lister
  • 45,515
  • 15
  • 108
  • 150
0

If you don't want to show numbers in order list then use this CSS code. Write code for className="disp" .disp{list-style-type:none;} this code will not show any numbers.

<div className="disp">
    <ol>
        <li>Apple<li>
        <li>Mango<li>
        <li>Orange<li>
    </ol>
</div>
gre_gor
  • 6,669
  • 9
  • 47
  • 52