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?

3
  • 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, 2014 at 17:10
  • 1
    @PatrikAlienus Indeed. Which is how I found this answer. Apr 18, 2017 at 9:34
  • 3
    Possible duplicate of Need an unordered list without any bullets
    – mab
    Jun 19, 2017 at 13:17

2 Answers 2

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

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>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.