0

I am using wordpress. I have a theme that is overwriting the lists.

So I guess I need to add my own class for lists.

I added a new div tag before I started my lists, but I guess I am still inside the other div tag that the system uses.

So how do I redeclare what I want the lists to do?

I just want them to be normal.

So I can add a custom div to the style.css that the theme calls.

I just don't know what I need to force the css to say.

For example in the css I could do:

.clearList as the name of the new div then define the lists to be normal, but how do I do that?

Then in the HTML I could just do:

<pre><div id="clearList">

<ul style="list-style-type: circle;">
<li>all the HTML</li>
<li>with lists here</li>
</ul>

</div></pre>

Anyone know what I mean and how to do it? thanks, Richard

Richard Jones
  • 45
  • 1
  • 8

1 Answers1

1

You want to set the list styles for each div you're using, so you can have various list styles depending on the particular list.

 div.clearlist li { /* some style */ }

as well as that, you might want to style the child elements

 div.clearlist > ul li { /* some style */ }

You can repeat this with other divs, should you wish.

Ronan
  • 821
  • 12
  • 30
  • exactly. I have to declare how to display them. But I don't know the CSS for the normal behaviours, like how far to indent them, how to make the circles, circles, how to make the numbers, digits or leading with a 0 digits, roman numerals, etc. – Richard Jones Feb 19 '14 at 11:13
  • An '
      ' is an ordered list with numerals, which can be styled differently to an '
      ' (Ordered list and unordered list). You can use list-style-type to set particular styles. Read more here: http://www.w3schools.com/cssref/pr_list-style-type.asp
    – Ronan Feb 19 '14 at 11:16
  • Yeah, I did use style="list-style-type: decimal" for numbers and use the different ones I got from w3schools But for some reason, the lists are still just showing up as just like line breaks, no indents, no numbers, alpha, anything. – Richard Jones Feb 19 '14 at 11:21
  • Can you put '!important' after your styles. This should overwrite the ones the theme is setting by default. – Ronan Feb 19 '14 at 11:54
  • just tested it, it did not work. :(
      – Richard Jones Feb 19 '14 at 11:57
    • You want to style this in the css, or remove the previous css styles in the css rather than in the
        itself. This should solve the issue.
      – Ronan Feb 19 '14 at 12:01
    • I am working on that now... making different ones for each of the ones I am using... div.clearlist ul.ua {list-style-type:upper-alpha;} div.clearlist ul.lr {list-style-type:lower-roman;} etc. after I'm done, I'll update this to say if it fixed it or not. – Richard Jones Feb 19 '14 at 12:05
    • You should try one sample one first to make sure it's working. – Ronan Feb 19 '14 at 12:07
    • I used Search and replace to do it fast in the whole thing... Here are the div css I created: div.clearlist ul.ua {list-style-type:upper-alpha;} div.clearlist ul.lr {list-style-type:lower-roman;} div.clearlist ul.la {list-style-type:lower-alpha;} div.clearlist ul.ulc {list-style-type:circle;} div.clearlist ul.uld {list-style-type:decimal;} then replaced them all in the ul tags. I tested it on that jsfiddle and it works. But in the page it is still not working. No idea why it won't work. :( – Richard Jones Feb 19 '14 at 12:15
    • Can you link to the actual website at all so we can see? Also, try make those styles !important and maybe it'll override the others. – Ronan Feb 19 '14 at 12:27
    • I added the !important and it did not fix it. I was creating a order form using Gravity forms, this is in a HTML section. Maybe it is not using CSS5, which I think that CSS Code is for, right? Not sure. At any rate, I'm just going to create the agreement on Micorosoft Word and use a signature page online, and have them order it that way. Have to get it done today, as a client wants to order it. So I had to give up. Maybe Later I can fix it for the future orders to be automated. Thank You for trying to help. Greatly appreciated! – Richard Jones Feb 19 '14 at 13:23