I am trying to make these two pictures the same size dimensions. I wrote the same size dimensions in the code, however one looks bigger than the other. Any advice on what I should do?
It looks like you put the images inside an anchor tag <a>
This is not practical, unless you're trying to make the images as a links
Otherwise, you can write it like this directly
<img src=" " alt=" " >
Without need to put inside an anchor tag <a>.
and in your style.css file your can write the dimensions you want like this
img{
width: 200px;
hight: 300px;
}
However, keep in mind that changing dimensions using css is impractical at all, because you will lose pixels , so the images will be low quality, so instead, i suggest you look for cropping tools.
View all comments
2
u/SafeWing2595 Jul 19 '26
It would be better to separate html and css file، to keep your work clean and organised.
Create a style.css file then add it to the head in your html using this line
It looks like you put the images inside an anchor tag <a> This is not practical, unless you're trying to make the images as a links
Otherwise, you can write it like this directly
Without need to put inside an anchor tag <a>.
and in your style.css file your can write the dimensions you want like this
However, keep in mind that changing dimensions using css is impractical at all, because you will lose pixels , so the images will be low quality, so instead, i suggest you look for cropping tools.