Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

any way to automate this formatting?

Enthusiast ,
Mar 28, 2020 Mar 28, 2020

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!

549
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 28, 2020 Mar 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 28, 2020 Mar 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 & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 28, 2020 Mar 28, 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!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 28, 2020 Mar 28, 2020
LATEST

I have a feeling we are re-visiting this question from last month.

https://community.adobe.com/t5/dreamweaver/target-list-items-of-paragraph-style-only/m-p/10916029?pa...

 

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines