Home > front end >  I need some assistance with CSS and making an image on my website smaller
I need some assistance with CSS and making an image on my website smaller

Time:09-25

I am making a html website for a art gallery and my code is getting a lot of syntax errors? Could I please have some help in solving the errors?

<style>
.wario {
  width: 100px;
  height: 100px;
}
</style>
<img src="https://i.redd.it/rkskucv0ycp71.jpg" class="wario" alt="photo of wario">```

CodePudding user response:

I think your width and height value is not correct.

<style>
 .wario {
  width: 50wh;
  height: 50vh;
}
</style>
<img src="https://i.redd.it/rkskucv0ycp71.jpg" class="wario" alt="photo of wario">

CodePudding user response:

You can make the width or height auto:

 .wario {
  width: auto;
  height: auto;
}

You can also use min/max:

 .wario {
  max-width: 100px;
  min-height: 80%;
}
  •  Tags:  
  • css
  • Related