查看完整版本 : 用Safari 開html

天下大一笨蛋 2017-10-27 09:51 PM

用Safari 開html

無知嘅我問一下,寫完個html碼喺window可以正常用chrome/IE開到,但喺去到Mac喺Safari打開只show返啲html碼出來,show唔到個網頁,應該點做?

口口口多水 2017-10-28 02:50 AM

command open index.html

前往懷舊的樓盤 2017-11-4 11:10 AM

up:smile_o06: :smile_o06:

fav link:[url=http://www.landglobalnet.com/]網頁製作[/url]

[[i] 本帖最後由 前往懷舊的樓盤 於 2017-11-24 03:58 PM 編輯 [/i]]

ncream 2017-11-4 04:17 PM

[quote]原帖由 [i]天下大一笨蛋[/i] 於 2017-10-27 09:51 PM 發表 [url=http://computer.discuss.com.hk/redirect.php?goto=findpost&pid=470016277&ptid=27020080][img]http://computer.discuss.com.hk/images/common/back.gif[/img][/url]
無知嘅我問一下,寫完個html碼喺window可以正常用chrome/IE開到,但喺去到Mac喺Safari打開只show返啲html碼出來,show唔到個網頁,應該點做? [/quote]

睇下呢樣關唔關事。

[url=https://stackoverflow.com/questions/14439513/browser-shows-plain-text-instead-of-html-in-mac]https://stackoverflow.com/questions/14439513/browser-shows-plain-text-instead-of-html-in-mac[/url]


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

[[i] 本帖最後由 ncream 於 2017-11-4 04:25 PM 編輯 [/i]]

Susan﹏汪汪 2017-11-4 04:54 PM

你講寫完html碼然後打開

係指用browser上網站去睇定係localhost

如果係網站睇的話content type 係咪正確?
頁: [1]
查看完整版本: 用Safari 開html