• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Pruebas Online
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

136
Vistas
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.

almost 3 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

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>

almost 3 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda