how to use the img tag

后端 未结 2 552
小蘑菇
小蘑菇 2021-01-16 16:33

i am a student working in an simple application and i do not know how to use the img tag and i have tryed one such code but while executing the code the image is not showing

相关标签:
2条回答
  • 2021-01-16 16:40

    The problem is that you are using an address to an image on your computer, so that will only work when you view the page from that specific computer.

    You should copy the image into the web application, for example into a folder named images, then you use that address in the image tag:

    <img alt="" src="images/images4.jpg" />
    
    0 讨论(0)
  • 2021-01-16 16:57

    Your image should be in the folder accessible to your web server. Try including your image into your solution file (assuming you are using Visual Studio), and use relative path, such as "/images/image4.jpg"

    Go to some web site (like www.cnn.com), view source for any page and see how they set path to img tags.

    You can also use ASP.Net image tag, check out MSDN for examples and usage.

    0 讨论(0)
提交回复
热议问题