skip to Main Content
.image{/*gotta fix. my boarder is
  changing but not the image*/ 
  display: block;
  margin-left: auto;
  margin-right: auto;
  
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 5px;
  max-width: 100%;
 
  width: 20%;
  height:auto;
  object-fit: fill;

I’ve tried style element inline and <style ></style> but neither Methode seem to work. my css code works but not for this line of code for some reason.

2

Answers


  1. Chosen as BEST ANSWER

    I figured it out. So I just deleted two of the div elements leaving one wrapped around all the images and p tag prices, so now the code works thank you guys for helping me.


  2. One reason why your images might not be changing their size to 50px in CSS could be that there is another CSS rule that is overriding the one you have written for sizing the images. You can try using the !important declaration after your CSS rule for the image size to ensure it takes precedence over any other rules that might be affecting it.For example, if you have written:

    img {
      width: 50px;
    }
    
    You can change it to:
    img {
      width: 50px !important;
    }
    

    Another reason could be that the selector you are using in your CSS rule is not targeting the specific images you want to resize. You can check the class or id of the image element and make sure it matches the selector in your CSS code.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search