为什么我的图像不显示为HTML? [英] Why won't my image show in HTML?

查看:66
本文介绍了为什么我的图像不显示为HTML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使图像显示在HTML页面上时遇到问题.我目前在.html文件所在的文件夹中有"image.png",但仍然无法使用.我正在使用Chrome btw.这是我的代码:

I'm having issues with getting an image to display on my HTML page. I currently have "image.png" in the same folder as the .html file and it still won't work. I am using Chrome btw. Here is my code:

<!DOCTYPE html>

    <head>
        <title> Title </title>
    </head>

    <body>
        <h1> This is an image </h1>
        <img src = "image.png" alt = "Image text"/>

    </body>

</html>

推荐答案

您似乎正在使用智能引号.您需要使用普通的.

You seem to be using smart quotes. You need to use normal ones.

用''替换" ,用"

<img src = "image.png" alt = "Image text"/>

您应使用诸如Notepad ++或Sublime Text之类的编程编辑器,因为它们不会将引号转换为智能引号

You should use a Programming Editor like Notepad++ or Sublime Text, since they do not convert quotes into smart quotes

并不是说您缺少开始的< html> 标记

Also not that you are missing the opening <html> tag

这篇关于为什么我的图像不显示为HTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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