CodeNewbie Community 🌱

Discussion on: Setting Up Width of Images In CSS

Collapse
 
iamspruce profile image
spruce

My bad
Am sorry I didn't explain well...
I just gave another "tip of setting images" for other pipo that may need it...
Your example is perfect by the way...
I once had to redesign a website for a client.
I wanted to add some avatars to the about us page


// So I just added the images
// And I set a width and height
<img src="" width="47px" height="48px" />

But when I previewed the page, the avatars where still talking their original sizes...
Well it was because the max-width: 100%; was still pretty active...
So I decided to change the max-width to none whenever I set the width and height inline(in the HTML)
And this worked


 img[width],
 img[height] {
 max-width: none;
}

I just thought this would be a good tip also but I don't know lol
Thanks again Ayu

Thread Thread
 
adiatiayu profile image
Ayu Adiati

Thank you so much for the tip!
I learn something new today 😊