Skip Navigation

[Resolved] CSS customization of Ordered List

This thread is resolved. Here is a description of the problem and solution.

Problem: I am using Views to output an ordered list with a nested unordered list. I would like to change the color of the number output by the ordered list.

Solution: Add this CSS to style the bullet (and everything else in the list item):

.wpv-loop > li {
  color: #ee7823;
}

Then if you want to change the text color for the nested list, you must override the text color to be dark gray again for those elements:

.wpv-loop > li ul {
  color: #3a3a3a;
}

Relevant Documentation:
https://www.w3.org/Style/Examples/007/color-bullets.en.html

This support ticket is created 4 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by deepS 4 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#1285539
Screenshot_1.jpg

I am trying to change the color of the ordered list. Somehow I achieved this but not able to do the things I am expecting. See the screenshot_1. The numbers are still in black color and even font sizes cannot be changed. Please let me know how to achieve this.

I have used this code for views:

<div class="post-name">Post: [types field="post-name"][/types]</div>
<ul>
<li><strong>No. of Vacancies:</strong> [types field="no-of-vacancies"][/types]</li>
<li><strong>Uppre Age Limit:</strong> [types field="upper-age-limit"][/types] years.</li>
<li><strong>Educational Qualification:</strong> [types field="educational-qualification" output='raw'][/types]</li>
<li><strong>Work Experience:</strong> [wpv-conditional if="( $(wpcf-work-experience) ne '' )"] [types field="work-experience" output='raw'][/types][/wpv-conditional][wpv-conditional if="( $(wpcf-work-experience) eq '' )"]Freshers may apply[/wpv-conditional]</li>
<li><strong>Salary:</strong> [types field="salary"][/types]</li>
</ul>

And used the following CSS codes:

.post-name {
  font-size: 1.3em;
  margin-bottom: 5px;
  color: #ee7823;
}
#1285695

Hello, I'm not able to see the code for the ordered list items (numbers) here. I'm only able to see the code for the unordered list items (bullets). Regardless, you can find examples for styling ordered lists here: https://www.w3.org/Style/Examples/007/color-bullets.en.html

The simplest solution is to style the entire list item to match the desired style of the number. Then add spans or additional internal markup to style individual elements within that list item.

If you want additional guidance, I need to see this in a browser. A screenshot is helpful, but I must see an actual live site to offer more assistance with the styles.

#1285899
Screenshot_3.jpg

I have created the view in loop editor option for generating views of the repeatable group fields. See the screenshot_3 for understanding.
See the url here: hidden link

#1286463

Add this CSS to style the bullet (and everything else in the list item):

.wpv-loop > li {
  color: #ee7823;
}

Then if you want to change the text color for the nested list, you must override the text color to be dark gray again for those elements:

.wpv-loop > li ul {
  color: #3a3a3a;
}
#1286621

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.