Need help to add images to HTML

<!DOCTYPE html> <body> <img src="mainpage.jpg"> <img src="secondpage.jpg"> <img src="thirdpage.jpg"> <img src="forthpage.jpg"> <img src="fifthpage.jpg"> <img src="lastpage.jpg"> </body> </html> Here is my Code
16 Replies
b1mind
b1mind3d ago
Are all those images in the same folder as the HTML? I would make sure you understand file paths
baller
ballerOP3d ago
Yeah they are. Do you want to see?
b1mind
b1mind3d ago
GeeksforGeeks
HTML File Paths - GeeksforGeeks
HTML file paths indicate the location of resources needed for a webpage, with two main types: absolute paths that provide the full URL and relative paths that specify the location in relation to the current document.
b1mind
b1mind3d ago
How are you trying to view the HTML where the images don't show up? Hosted? Local http ?
baller
ballerOP3d ago
Local
b1mind
b1mind3d ago
Are you using a web server? Or just trying to open file://
baller
ballerOP3d ago
Open
b1mind
b1mind3d ago
That's your issue then
baller
ballerOP3d ago
Thank you so much! I'll try it right now.
b1mind
b1mind3d ago
If you are using vs code there is an official extension https://marketplace.visualstudio.com/items?itemName=ms-vscode.live-server
Live Preview - Visual Studio Marketplace
Extension for Visual Studio Code - Hosts a local server in your workspace for you to preview your webpages on.
b1mind
b1mind3d ago
Live server extension is another popular choice
baller
ballerOP3d ago
Ok Ok I installed it. Thank you so much @b1mind
b1mind
b1mind3d ago
Glhf!
baller
ballerOP3d ago
I can't see the images still, they have all the content for my portfolio.
b1mind
b1mind3d ago
I would think html would still parse it right but maybe you need to properly self close the <img src="" /> I mean you should anyway.
Sleep Twitch
Sleep Twitch3d ago
Your webpages are just images of a page?

Did you find this page helpful?