How to give src to the

前端 未结 8 1604
抹茶落季
抹茶落季 2020-12-09 21:11

I want to display an image on a web page using HTML tag.

I have stored the image on my local drive.

How to achieve this?

Th

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-09 21:55

    Well, as there are many issues with different browsers and so with Apache paths config, I tried all the possible ways file: file:// c: c| and none of them worked on my Firefox 57.0 in W7, so there is a fast solution (if you use php). Just call a file "embedIMG.php" with this content:

        
    

    Call this "embedIMG.php" from your img tag:

       
    

    THEPATHTOYOURIMAGE will be the path to your image "D:\Images\TechnipLogo.jpg", it's better to do it this way "D:/Images/TechnipLogo.jpg" with common slashes on Windows. If you have spaces or special characters in your path you will have to declare it with urlencode() function:

      
    

提交回复
热议问题