1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HTML list for terms and rules

Discussion in 'XenForo Questions and Support' started by twollert, Dec 5, 2011.

  1. twollert

    twollert Active Member

    I would like to use a html list in the phrase "terms_rules_text". Like that:

    But XenForo ignores the "type" attribute.

    So instead of

    a. rule 1
    b. rule 2
    c. rule 3

    I always get

    1. rule 1
    2. rule 2
    3. rule 3

    What is the reason for that?
     
  2. Floris

    Floris Guest

    OL = Ordered list.
    UL = unordered list.

    [edit]
    Oops, it submitted the post, but for some reason the rest wasn't included.
    Now I have to type it again.

    type attribute is deprecated in html 4, but legacy support for html5 is there as far as I know
    so you have to do this with css now (best pract.)

    HTML:
    ul[type="disc"] { list-style-type: disc; }
    ul[type="circle"] { list-style-type: circle; }
    ul[type="square"] { list-style-type: square; }
     
    ol[type="1"] { list-style-type: decimal; }
    ol[type="a"] { list-style-type: lower-alpha; }
    ol[type="A"] { list-style-type: upper-alpha; }
    ol[type="i"] { list-style-type: lower-roman; }
    ol[type="I"] { list-style-type: upper-roman; }
    http://www.w3.org/TR/css3-lists/
    http://www.w3schools.com/css/css_list.asp
     
    Fuhrmann and Mikey like this.
  3. Mikey

    Mikey Well-Known Member

    It should be parsing it as regular HTML.

    Try this?

    Code:
    <style>
    ol {
    list-style-type:lower-alpha;
    }
    </style>
    <ol>
    <li>rule 1</li>
    <li>rule 2</li>
    <li>rule 3</li>
    </ol>
    
     
    Fuhrmann likes this.
  4. twollert

    twollert Active Member

    Thanks for that info, I didn't know that.

    I tried

    Code:
    <ol style="list-style-type: upper-alpha">
    <li>rule 1</li>
    <li>rule 2</li>
    <li>rule 3</li>
    </ol>
    and Mikey's suggestion, but I always get 1., 2., 3. instead of a., b.,c.. :cry:
     
  5. meursault

    meursault Member

    Sorry to brutally necropost, but I was wondering if this issue has been resolved. I currently have the exact same problem, I want to make my OL list have letters instead of numbers.
     
  6. Mike

    Mike XenForo Developer Staff Member

    You'd need to apply the list-style-type to the <li> to override the reset CSS.
     
  7. Boothby

    Boothby Active Member

    You could add a style-tag above the rules, like this:
    HTML:
    <style>
    .baseHtml ol li {
        list-style-type: upper-alpha;
        font-weight: bold;
    }
     
    .baseHtml ol ol li {
        list-style-type: lower-alpha;
        font-weight: normal;
    }
    </style>
     
     
    <ol>
        <li>Chapter 1
            <ol>
                <li>Rule 1</li>
                <li>Rule 2</li>
                <li>Rule 3</li>
            </ol>
        </li>
        <li>Chapter 2
            <ol>
                <li>Rule 1</li>
                <li>Rule 2</li>
                <li>Rule 3</li>
            </ol>
        </li>
        <li>Chapter 3
            <ol>
                <li>Rule 1</li>
                <li>Rule 2</li>
                <li>Rule 3</li>
            </ol>
        </li>
    </ol>
     
  8. twollert

    twollert Active Member

    @Boothby: Thanks a lot... this works great! (y)
     
  9. Boothby

    Boothby Active Member

    @twollert , thanks for your feedback.
     

Share This Page