css - How to reference path, given that I want to include an image in HTML file that resides on a different drive than my HTML d

Here's the problem:HTML Document Location- G:html filesprojectshtmlformsindex.htmlImage Loca

Here's the problem:

HTML Document Location- G:\html files\projects\htmlforms\index.html

Image Location- D:\resources\images\stock images\logo.jpg

Is this some folder permission problem ?

I've tried- <img src="file:///D:/resources/images/stock images/logo.jpg" alt="image">

I am just expecting an simple image to be display

Here's the problem:

HTML Document Location- G:\html files\projects\htmlforms\index.html

Image Location- D:\resources\images\stock images\logo.jpg

Is this some folder permission problem ?

I've tried- <img src="file:///D:/resources/images/stock images/logo.jpg" alt="image">

I am just expecting an simple image to be display

Share Improve this question edited Nov 19, 2024 at 20:31 divaura asked Nov 19, 2024 at 20:30 divauradivaura 12 bronze badges 2
  • is this answer your question? – mehdi ahmadi Commented Nov 19, 2024 at 21:11
  • If the HTML file is opened in the browser as file:///G:/html files/projects/htmlforms/index.html then it should just work (I just tried). However if you open the HTML file through a local web server using something like http://localhost/ .. .. .. /index.html then the browser will block everything that uses a file: URL for security reasons. You simply can not use file: from a page hosted on a web server. – Peter B Commented Nov 19, 2024 at 22:44
Add a comment  | 

1 Answer 1

Reset to default -1

I'm pretty new to HTML and CSS myself, but from what I know, the image has to be in the same folder and have the .html in the image's file name. It should be relatively simple to move the image's location, so no need to stress there. It will also help to shorten the image's link. Here's an example tag:

<(img src="cvpfp.html.jpeg" alt="Profile Picture">

(Please don't include the parentheses in the tag, that just helps it show up on stack overflow) In this case, I had emailed the image to myself from my phone and downloaded it. my source consists of the file name, the document type, and the image type.

I really hope this helps! Please let me know if I can clarify anything or answer any other questions.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742400205a4436759.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信