Search code examples
htmlcssstyles

Overwriting an element.style attribute for an image


I am using this <div class="wk_seller_store_logo" data-productid ="{{product.id}}"></div>

to insert an image linking back to a profile and I believe the element.style is controlling the image size at 50px as I can change it in the inspector but cannot figure out how to overwrite either the java script or CSS. Is it a simple overwrite i can add to the html? max-height 250px !important or something like this?

Thanks guys, totally new here!


Solution

  • IF the image is rendered in the div which you gave above <div class="wk_seller_store_logo" data-productid ="{{product.id}}"></div> , then you can simply add the following rules in your CSS file to override the image element styling:

    .wk_seller_store_logo img{
        width:250px !important;
        height:250px !important;
    }
    

    If you want to change it using js then please share the js code which is adding the element style to image.