Yo,
Can somebody tell me the code to put an image file in to an html document.
But not from a URL but from a file saved yo my computer!
Thanks ;)
Yo,
Can somebody tell me the code to put an image file in to an html document.
But not from a URL but from a file saved yo my computer!
Thanks ;)
You have to provide a path to the image. HTML documents use URLs for paths. If the image is in the same directory as your html file, then you use the filename.
The tag is "img":
<img src="myImage.jpg">
You have to upload your image first, you can't just host it off of your computer.
If your html page utilizes this image on multiple pages I would move the logic to a css file. It’s also good practice
You could do something like this in a css file if it were a background image or something. Just an example.
body{background: url(path/to/image/on/your/computer/image.gif) repeat-y;}
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.