How do I properly resize an image in HTML using VSCode?

May 10, 2025 3 answers
Asked by CodingNewbie88
I'm a total newbie to coding—I literally just started learning HTML yesterday with about two hours of experience under my belt. I'm using 'live server' to preview my code, and resizing the image works just fine there. However, when I try to 'open in browser' using a popular extension, the image remains huge. Here's the code I'm using: ```html Close up shot of man programming what looks to be C or some derivative, but it only shows his fingers and there's blur on most of it. ``` I'm still pretty lost and would appreciate any guidance!

Answers

TechieTom123
You should try reducing the height and width values a bit more. Something less than 70% could help with fitting it better.

CodingNewbie88: ight, thanks!

Reply to this answer
PixelPioneer56
Another simple fix is to just remove the percent signs from the height and width styles. You could use actual pixel values instead.

CodingNewbie88: ok thanks!

CodeMaster92: Think they also need to lose the semicolons in the style as they aren’t necessary.

Reply to this answer
HelpfulHannah25
Just a heads up, your alt attribute is a bit over the top! Also, the code is making your image 70% the size of its parent container, so you might want to adjust that if it’s still too big.

CodingNewbie88: I like to be descriptive, thanks for the help!

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions