在html中添加图像 [英] Adding Image in html

查看:118
本文介绍了在html中添加图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法在html中添加图像.我正在使用ASP.net MVC3.名为KeyLargoPic的图像位于闪存驱动器中的文件夹X:\ Project \ Project \ Photos \ Key Largo中,它似乎是JPEG.代码如下:

I cannot seem to add an image in html. I'm using ASP.net MVC 3. My image, named KeyLargoPic, is located on a flash drive in the folder X:\Project\Project\Photos\Key Largo, and it appears to be a JPEG. The code is as follows:

<td><img src="X:\Project\Project\Photos\Key Largo\KeyLargoPic.jpg" alt="IMAGE" /></td>

每次加载页面时,都会在其中显示带有"IMAGE"的框.有人知道我在做什么错吗?

Every time the page loads, it shows the box with "IMAGE" inside. Does anyone know what I'm doing wrong?

推荐答案

将图像添加到项目中(可能在内容目录中),方法是右键单击目录,然后依次单击添加"和现有项目",浏览到jpeg然后点击添加".现在将图像作为项目的一部分,您可以将其添加到网页中,如下所示:

Add the image to your project, probably in the content directory, by right clicking the directory and clicking "Add" then "Existing Item", browse to your jpeg and click "Add". With your image now part of the project you can add it to the webpage like so:

<td><img src="@Url.Content("~/Content/KeyLargoPic.jpg")" alt="IMAGE"></td>

这篇关于在html中添加图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆