Insert an image in Notepad

louane -  
 Trucul -
Hello,

I'm trying to insert an image into my notepad for my website
I've saved my image "Hedy_lamarr_-_1940" on the desktop just like my website
I typed this code:

<img src="desktop/Hedy_lamarr_-_1940" alt="photo Hedy lamarr">

Configuration: Windows / Edge 18.18362

3 answers

Trucul
 
Hello,

"Is your file really in .html format?"
No, Dinath was talking about the file, not the folder.
If this hasn’t been done, you should follow these steps:
https://www.commentcamarche.net/informatique/windows/185-afficher-les-extensions-et-les-fichiers-caches-sous-windows/

<img src="bureau/Hedy_lamarr_-_1940" alt="photo Hedy lamarr"> 

is incorrect for the image URL (address); it’s already missing the file extension (jpg, png, etc.).
You need to use a relative URL that starts from the root folder (the level 0 of the site corresponding to the location of the HTML files, see details in the link at the end of this message). For example, if the image is in the same folder, it will look like this:

<img src="Hedy_lamarr_-_1940.jpg" alt="photo Hedy lamarr"> <!-- if the image is in jpg format and at the same level (folder) as the page //-->


With a folder named "images" at the same level as the page, it looks like this:
<img src="images/Hedy_lamarr_-_1940.gif" alt="photo Hedy lamarr"> 

Because "Bureau" is not the actual address of the Bureau folder and does not correspond to anything on the HTTP server of your host, which will not have a desktop.

Also avoid special characters and uppercase letters in file names on the web, as they may not be read correctly on servers and can cause errors.

The desktop is not meant for that; it would be clearer to create a file to organize all the site's files. Besides, everything on the desktop is available at any time, which unnecessarily uses memory and can slow down the computer.
Additionally, having everything in a dedicated folder will be much simpler when it comes time to publish, as you can migrate everything at once via FTP.

For clarity, you can also create folders to separate images from the rest of the pages. When you have several, it’s easier to group them this way.

https://www.lumni.fr/article/apprendre-le-html-url-absolue-et-url-relative
3
Dinath Posted messages 1697 Status Security Contributor 218
 
Hello,

Does your file have the .html extension?

--
@Dinath_ - Security Contributor
1
louane
 
If you are talking about the file where my site and my image are, then I don't believe it. What can I do?
1