Sublime Forum

I can't preview my HTML code in Chrome (Sublime 3)

#1

I’m sorry if this has been asked before, but I’m very new to this and I can’t seem to find anything that has helped.

I am able to open up my index.html file in Chrome (it’s now set as the default browser). However, it only shows the actual HTML that I’ve written down when I open in the browser. I have put the title tags in with the title as Cheat Sheet, but when I open it in the browser, the tab says :

file:///E:/Sublime%20Text%203/Packages/index.html.txt

I know that the HTML code is correct, as I’ve just pasted it onto here and it works!

Is there any way to fix this?

0 Likes

#3

It looks like your problem is that the extension on your file is .txt instead of .htm or .html, so the browser is treating it as plain text. If you rename your file to the name index.html, it should do what you want.

0 Likes

#4

Thank you, it is working now!

0 Likes