+ 4

Whenever I add images to html....doesnt show up in chrome browser ....???? HELP....

Chrome

19th Jul 2020, 5:40 AM
Kaman Singh
Kaman Singh - avatar
21 Réponses
+ 4
I faced the same thing, when I was coding with my smartphone
19th Jul 2020, 6:50 AM
Abosi Godwin
Abosi Godwin - avatar
+ 3
<!DOCTYPE HTML> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Images Slider Gallery</title> <style> button { margin-top: 30px; float:left; height:50px; border:4px solid blue; background-color:yellow; border-radius:10px; font-weight: bold; } img { float:left; margin-right: 10px; margin-left: 10px; } </style> </head> <body> <div> <button onclick="prev()">Prev</button> <img id="slider" src="Instagram.png" width="150px" height="100px"> <button onclick="next()">Next</button> </div> <script> var images= ['Instagram.png', 'Facebook.png', 'Twitter.png']; var num=0; function next() { var slider= document.getElementById('slider'); num++; if(num>=images.length) { nu
19th Jul 2020, 5:51 AM
Kaman Singh
Kaman Singh - avatar
+ 2
Kaman Singh , you can try copying the location of image from properties.
19th Jul 2020, 4:25 PM
Chirag Mehta
Chirag Mehta - avatar
+ 2
It depends if the picture is in the same folder as the html file This is for local images <img src="/file path/">
20th Jul 2020, 9:46 AM
Dickson Dzidula
Dickson Dzidula - avatar
+ 1
paste your code here
19th Jul 2020, 5:49 AM
hackxsaras
+ 1
Hey, can you just make a new program and share the link, that's what I meant
19th Jul 2020, 5:52 AM
hackxsaras
+ 1
How to get link of html file
19th Jul 2020, 5:55 AM
Kaman Singh
Kaman Singh - avatar
+ 1
If you have pasted it in sololearn, save it, and then click on the share button (right top), copy the link and paste here
19th Jul 2020, 5:56 AM
hackxsaras
19th Jul 2020, 5:58 AM
Kaman Singh
Kaman Singh - avatar
+ 1
where is rest of the script bro? that code is incomplete..
19th Jul 2020, 5:59 AM
hackxsaras
+ 1
Why incomplete? Css and js are both inside this code
19th Jul 2020, 6:00 AM
Kaman Singh
Kaman Singh - avatar
+ 1
Scroll down,,...
19th Jul 2020, 6:01 AM
hackxsaras
19th Jul 2020, 6:03 AM
Kaman Singh
Kaman Singh - avatar
0
Your code is absolutely fine, just make sure, the images are in same folder as the html document is, if it's so, try to provide absolute paths
19th Jul 2020, 6:07 AM
hackxsaras
0
Images are in same folder but still not working
19th Jul 2020, 6:09 AM
Kaman Singh
Kaman Singh - avatar
0
Help
19th Jul 2020, 6:11 AM
Kaman Singh
Kaman Singh - avatar
0
try to give absolute paths, it should be like file:///.... your full path
19th Jul 2020, 6:12 AM
hackxsaras
0
How to give absolute path ....give me an example
19th Jul 2020, 6:13 AM
Kaman Singh
Kaman Singh - avatar
0
I once had an issue of this sort. This is what you have to do. Make sure the image is in the folder of your HTML document. Let us take an instance that the image "fish.jpeg" is in the folder "images". Then your image tag in the document should look like this: <img src="images/fish.jpeg" alt=""/> Please contact me if this does not work. Thanks.
19th Jul 2020, 3:18 PM
Favour Leopold
Favour Leopold - avatar
0
Sometimes if the file format is not the same, in the HTMl and the actual file, an example: in the HTML directory... image.jpg, in the document image.png, it won't work, you can right click the image file and select properties and view the file format(windows 10) or you can turn on "file name extensions" in file explorer(windows 10) that should help you out..
20th Jul 2020, 10:16 AM
Tekashi69{Oliseh}
Tekashi69{Oliseh} - avatar