在浏览器上打开html文件时,我看到了源代码 [英] when opening an html file on browser, I see the source code

查看:216
本文介绍了在浏览器上打开html文件时,我看到了源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在浏览器(chrome/explorer)上打开基本的"hello world" html文件.但是,浏览器将显示代码本身而不是预期的结果.可能是什么问题?

I am trying to open a basic "hello world" html file on a browser (chrome/explorer). However, the browser displays the code itself rather than the expected result. What can be the problem?

代码:

<!DOCTYPE html>
<html>
  <head>
    <title>Hello, World!</title>
  </head>
  <body>
    <h1>Hello, world!</h1>  
  </body>
</html>

我刚刚在名为helloWorld.html的文本文件中编写了此代码,并使用浏览器将其打开. 谢谢!

I've just written this code in a text file called helloWorld.html and opened it with the browser. Thanks!

推荐答案

您的html很好,我敢打赌,您将其另存为index.html.txt(偶然发生) 你能检查一下吗:)

your html is fine my bet is you saved it as index.html.txt(on accident) Could you please check for that :)

这篇关于在浏览器上打开html文件时,我看到了源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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