styling list using css

  • Unknown's avatar

    I am trying to style a li tag with a class in a style sheet. I can get the desired styling using an inline style but cannot get it to work using style sheet. Here is the inline code:

    <ul>
      <li style="margin-left: 70px;">Item 1</li>
      <li style="margin-left: 70px;">Item 2</li>
        <li style="margin-left: 90px;">Indented item 1</li>
        <li style="margin-left: 90px;">Indented item 2</li>
    </ul>

    In the WordPress page, I have tried:

    <ul>
      <li class="indentLi70">Item 1</li>

    In the style sheet, I have tried:

    ul li .indentLi70 {
         margin-left: 70px;
    }
    
    .indentLi70 {
         margin-left: 70px;
    }
    
    li .indentLi70 {
         margin-left: 70px;
    }

    When I refresh the html page, nothing works.

    Can someone please tell/show me what I am doing wrong? Thank you.

  • The topic ‘styling list using css’ is closed to new replies.