浏览器在mac中显示纯文本而不是HTML [英] Browser shows plain text instead of HTML in mac

查看:476
本文介绍了浏览器在mac中显示纯文本而不是HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想写一个像这样的html文档:

 < html> 
< body>

< h1>我的第一个标题< / h1>

< / body>
< / html>

我把它写在桌面上,名字是 hello.html ,但是当我用firefox或safari打开这个文件时,浏览器会显示整个文本(包括< html> 和所有的文本)而不是只显示我的第一个标题
有什么问题?

解决方案

问题在于我用文本编辑应用程序编写了HTML文档,它使用 .rtf 扩展名保存文件,这不是纯文本,因此将文件名改为 hello.html

有两种方法可以解决这个问题:

1)如果你坚持使用文本编辑,你应该去文本编辑 - >首选项并在顶部打勾纯文本的页面,然后当你保存的东西,它被保存为纯文本



2)你可以使用一些文本编辑器,如石灰编辑

I want to write an html document like this :

<html>
<body>

<h1>My First Heading</h1>

</body>
</html>

I wrote it and saved it in my desktop with the name hello.html , but when I open this file with firefox or safari, the browser shows the whole text (including <html> and all of the texts) instead of only showing my first heading! what's the problem?

解决方案

The problem was that I wrote the HTML document with "Text Edit" application, and it saved the file with .rtf extension, that is not plain text, so changing the name of file to hello.html didn't change anything.

there are two ways to fix this problem:

1) if you insist on using "Text Edit" you should go to text edit->preferences and tick the plain text at top of the page, then when you save something, it is saved as plain text

2) you can use some text editor, like lime edit

这篇关于浏览器在mac中显示纯文本而不是HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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