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
Are all those images in the same folder as the HTML? I would make sure you understand file paths
Yeah they are.
Do you want to see?
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.
How are you trying to view the HTML where the images don't show up?
Hosted? Local http ?
Local
Are you using a web server? Or just trying to open file://
Open
That's your issue then
Thank you so much! I'll try it right now.
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.
Live server extension is another popular choice
Ok
Ok I installed it.
Thank you so much @b1mind
Glhf!
I can't see the images still, they have all the content for my portfolio.
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.
Your webpages are just images of a page?