Question

I got a piece of code as seen in the image below in a Smarty template outputting the payment method. Please help me a find a way to set color "red" only to the value of "{$search_results_list[searchresults].cc_type}". Thank you.

enter image description here

Was it helpful?

Solution

What does the surrounding HTML look like?

If you cannot edit the HTML to add classes you could use :nth selector to select that second span tag, ie.

.surrounding-div span:nth-child(2) {color: red;}

Or if there are multiple span elements you could get more specific like this:

.surrounding-div span[title^="Payment"]:nth-of-type(2) {color: red;}

If you provide more of the template HTML it would be easier to answer more accurately.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top