伙计我有img标签有问题请帮忙 [英] Guys I have a problem with img tag please help

查看:81
本文介绍了伙计我有img标签有问题请帮忙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我的HTML代码如下,我正在尝试将此图片包含在我的网站上,但它无效。它只显示一个'x',就是这样。我尝试了很多不同的YouTube视频,但都没有。你们建议做什么?是否有一个设置在浏览器上阻止任何这个...我只是想说我的img在我的桌面上的一个名为我的网站的文件夹中,然后在该文件夹中有一个HTML文件夹,其中有我的index.html有我的Images文件夹,当然包含我的图片。

我明白html是区分大小写的,所以请,如果你能帮忙的话,我将不胜感激,谢谢你!

我也希望每个人都知道我的老师在网站上上传了他的index.html作为我们的一个例子。但它仍然给了我'x'。以下是我的代码,如果它有帮助:再次非常感谢。

Hi guys,
My HTML code is below, I am trying to include this image on my website, but it is not working. It just shows an 'x' and that's it. I tried so many different youtube videos but none of them worked. Would you guys suggest doing? Is there a setting on browser that's blocking any of this... I'd just like to state that I have my img in a folder on my desktop called "My Website", then inside that folder a "HTML" folder which has my "index.html" which has my "Images" folder, which contains of course my image.
I understand that html is case sensitive so please, if you can help I'll be grateful thank you!
I'd just like everyone to know also that my teacher uploaded his index.html as an example for us on the website. But still it gives me that 'x'. Below is my code if it helps: Thank you very much again.

<!DOCTYPE HTML>
<html>
    <head>
        <title>My first website</title>        
<meta http-equiv="My website" content="text/html; charset=uft-8"/>
    </head>  
    <body>
	<img src="Images/flightsiminside.jpg" height="267" width="400"/>
    <div>
	<header>
	   <h1>My Website</h1>
        </header>
    </div>
    </body>   
</html>





我的尝试:



- YouTube

- 研究

- 检查我的代码

- 更改目录

- 更改图像



What I have tried:

- YouTube
- Researched
- Checked my code
- Changed directories
- Changed images

推荐答案

如果HTML文件在右侧,您的代码将为我工作并显示图像地点。它需要位于具有Images子目录的同一文件夹中,Images文件夹需要包含文件flightsiminside.jpg,该文件需要是有效的图像文件。



检查那个地段,看看你得到了什么。正如我所说,粘贴到新HTML文件中的代码对我来说很好。
Your code works and displays an image for me, provided that the HTML file is in the right place. It needs to be in the same folder that has the Images subdirectory, and the Images folder needs to contain the file "flightsiminside.jpg" which needs to be a valid image file.

Check that lot, and see what you get. As I say, your code pasted into a new HTML file works fine for me.


这是如何完成的: HTML图像 [ ^ ]



考虑到这一点,您还应该考虑CSS(CSS3,这些天)作为高度和属性工作,但不是做事的方式< img style ='height:267px;宽度:400px;'>



话虽如此,图片未显示的最常见问题是(1)拼写错误的文件名或(2)没有图像的正确路径。



此外,HTML不区分大小写。但是,文件名和路径可能是,具体取决于操作系统和托管您网站的服务器类型。
Here's how it's all done: HTML Images[^]

With that in mind, you should also look into CSS (CSS3, these days) as height and with attributes work, but are not the way to do things <img style='height:267px; width:400px;'>

That being said, the most common problem with images not showing is either (1) misspelling the file name or (2) not having the correct path to the image.

Also, HTML is not case sensitive. File names and paths, however, might be, depending upon the Operating system and type of server hosting your website.


Hello

您的代码没有问题。尝试确保源代码在您的项目中。如果想要退出项目中的文件夹,你需要为每个文件夹写../以便从中获取。或者您可以将图像拖动到Visual Studio中的HTML页面,它将自动解决源代码。

希望它可以正常工作
Hello
Your code has no problem. try to make sure that the source is in your project. if want to get out of a folder in your project you need to write "../" for each folder to get back from were you are. or you can drag your image to your HTML page in Visual Studio, it will address the source automatically.
hope it works


这篇关于伙计我有img标签有问题请帮忙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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