e1commerce.com
Ask a question
  • New questions
  • With the answers
  • Unanswered
  1. Home
  2. html - Target specific element in label class

75 votes
1 answers

html - Target specific element in label class

This question already has answers here:
Undefined asked
2022-08-25


578
votes

Answer

Solution:

First of all, you have to put dots when you are using classes to select elements.

.selectorv2 > .sn_ys > span:nth-child(2) {
  color: red;
}
<label class="selectorv2" for="{{ section.id }}-{{ forloop.index0 }}">
   <div class="sn_ys">
      <span class="swatch_title">{{ variant.title }}</span>
      <span class="eraser_text">{{ variant.metafields.custom.variantqty }}</span>
      <div class="swtch_you_save">{{ variant.metafields.custom.variantoffer }}</div>
   </div>
   <div class="prie_grp">
      <span class="var_price">{{ variant.price | money }}</span>
      <span class="var_prce">
      <s class="var_com_price">{{ variant.compare_at_price | money }}</s> 
      </span>
   </div>
</label>
Undefined answered
2022-08-25
Link to answer


Source

Didn't find the answer?

Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Similar questions

Find the answer in similar questions on our website.

520 html - Target specific element in label class
732 javascript - Script not removing class from targeted element
266 html - With pure JavaScript, hide an element based on swatch active class and data-swatch-option?
573 json - Adding a specific collection to a specific page in Shopify
755 javascript - Avoid checkout for specific products on specific country in Shopify | if condition work only once
783 javascript - Element div not allowed as child of element a in this context
906 conditional statements - In Liquid, can we display an html element in an email according to the messaging used system?
514 Render as HTML the line_item.properties data who has HTML values in it on Shopify Admin Orders
848 html - How to include specific button on click action within url
816 html - Shopify - How to call images and tittles from a specific collection into the product recommendation module

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.







Latest questions:

33 Get product description with metafield in shopify

543 html - CSS animation looks wrong/broken in some places on iOS devices only?

408 Shopify refund amount wrong when refund in pending state (Admin REST API)

527 How to Add Fonts to the Shopify Admin

423 css selectors - Custom font for specific language shopify



© 2021-2023

E-mail: infot@e1commerce.com