Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

317
Views
How can I change the image inside a tag with css?

What I am trying to do is change the image and the "width" attribute of the image that is inside the "payment_method_micuentawebstd" label.

<label for="payment_method_micuentawebstd">
        Creditcard <img style="max-width: 85px; max-height: 30px;" src="https://yokiut.com/wp-content/plugins/woo-micuentaweb-payment//assets/images/micuentaweb.png" alt="Pago con tarjeta de débito / crédito">   </label>

I tried to do it like this, but I can't find the way:

#payment > ul > li.wc_payment_method.payment_method_micuentawebstd > label > img{
    max-width: 100% !important;;
/*content: url("https://yokiut.com/wp-content/uploads/2021/12/Tarjetas.png");*/
}

EDIT: I managed to change the width, but "content" doesn't change the image, it just puts it below the "src" of the html.

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Try this,

You are might not using the selector correctly. Need to see HTML but according to your CSS selector, I added HTML accordingly.

If your HTML is different add/update to the question.

#payment > ul > li.wc_payment_method.payment_method_micuentawebstd > label > img{
    max-width: 100%;
    /* random image url */
    content:url("https://media.istockphoto.com/photos/human-crowd-forming-a-chain-symbol-bonding-and-social-media-concept-picture-id936347578");
    
    /* 
    image url provided by you is commented to see change
    content:url("https://yokiut.com/wp-content/uploads/2021/12/Tarjetas.png"); */
}
<div id="payment">
    <ul>
      <li class="wc_payment_method payment_method_micuentawebstd">
        <label for="payment_method_micuentawebstd">
            Creditcard 
            <img style="max-width: 85px; max-height: 30px;" src="https://yokiut.com/wp-content/plugins/woo-micuentaweb-payment//assets/images/micuentaweb.png" alt="Pago con tarjeta de débito / crédito">  
         </label>
      </li>
    </ul>
</div>

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!