Highlighted

any way to automate this formatting?

Enthusiast ,
Mar 28, 2020

Copy link to clipboard

Copied

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!

Views

357

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

any way to automate this formatting?

Enthusiast ,
Mar 28, 2020

Copy link to clipboard

Copied

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!

Views

358

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 28, 2020 0
Adobe Community Professional ,
Mar 28, 2020

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 28, 2020 2
Adobe Community Professional ,
Mar 28, 2020

Copy link to clipboard

Copied

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, ACP
Alt-Web Design & Publishing

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 28, 2020 0
Adobe Community Professional ,
Mar 28, 2020

Copy link to clipboard

Copied

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.


Ben

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 28, 2020 1
Adobe Community Professional ,
Mar 28, 2020

Copy link to clipboard

Copied

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, ACP
Alt-Web Design & Publishing

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 28, 2020 1