Skip to main content
Inspiring
March 28, 2020
Question

any way to automate this formatting?

  • March 28, 2020
  • 3 replies
  • 633 views

Hi,

 

I apply a custom class to my ul tag so that the spacing is styled to my liking. Yes, I have to manually apply that to the tags.

The question is, how can I automate this formatting so that another person typing content and making a bulleted list would not need to touch the code to apply that class?

 

Is there a way? Is it via a small javaScript snippet? Appreciate the feedback.

 

Thank you!

    This topic has been closed for replies.

    3 replies

    BenPleysier
    Community Expert
    Community Expert
    March 29, 2020

    If it is the case that all unordered lists in your site adhere to the same style rules, there is no need for the class. You can use the element (UL) as the selector.

     

    If it is a case that all unordered lists in the same document need the same styling, then you can place the style rules in the <head> section of the page using UL as the selector. Again, no need for a class.

    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
    Nancy OShea
    Community Expert
    Community Expert
    March 29, 2020
    Nancy O'Shea— Product User & Community Expert
    Nancy OShea
    Community Expert
    Community Expert
    March 28, 2020

    I agree with Ben.  There's no reason to use an additional class if you don't need one.

     

    The specificity of the container selector plus the ul and li tag should be all that's required to style the element.  Anyone adding a bulleted list to that container should experience the same styles without having to insert additional class names.

     

    Nancy O'Shea— Product User & Community Expert
    Community Expert
    March 28, 2020

    I would change your class to include the container that the ul is inside of. Like .container ul or #container ul.  Then apply the formatting to any ul in that div or outer container.