There are 2 ways for opening .html files in Google chrome.
Way 1 :
Right click on the .html file and select open with Google chrome.
Way 2 :
- Open Google Chrome
- Press ctrl + o
- A window opens
- Navigate to your destination folder and click on your .html file
That's it. There you go.
Hope This is helpful.
Answer from Areg Nikoghosyan on Stack OverflowThere are 2 ways for opening .html files in Google chrome.
Way 1 :
Right click on the .html file and select open with Google chrome.
Way 2 :
- Open Google Chrome
- Press ctrl + o
- A window opens
- Navigate to your destination folder and click on your .html file
That's it. There you go.
Hope This is helpful.
Just paste the path of the html file including the .html to the browser. Eg, c://Desktop/user/project/file.html -> paste on url
Videos
Total beginner here, when I create an HTML document (on NotePad) and then save it on my desktop, its icon switches automatically to a Chrome icon, which can only be opened as the Web page and not the code, or at least that is what I am observing. Can anyone show me how to reopen the page code ?
I use Mac and not familiar with Vscode I want to open some html file in Chrome so far I try two methods :
First , click Run and Debug, html opens to safari which i dont want that . Second , I choose launch Chrome selection in nav bar , it launchs Chrome page but it’s an error page.
After thet I open html by using terminal by using open command : open index.html the files opens in safari
How can I fix that ? Thanks in advance .
Didn't help.
Hi codeispoetry,
See if changing the defaults to Firefox and then reverting to Chrome helps.
Right-click on a HTML file and click Properties.
Click "Change"
Select Firefox, and click "Set default.
Right-click on a HTML file and click Properties.
Click "Change"
Select Google Chrome, and click "Set default.
As a recent Mac OS adopter I too ran into this. For me, it was due to using TextEdit, and expecting it to act like Notepad.
When you save a .html file in TextEdit, it encodes the HTML and wraps it for you, without any notification.
Viewing source, or opening the file in vim or more in terminal shows what has been applied:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1265">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Helvetica; min-height: 16.0px}
</style>
</head>
<body>
<p class="p1"><!DOCTYPE html></p>
<p class="p1"><html></p>
<p class="p1"><head></p>
<p class="p1"><title>Test</title></p>
<p class="p1"></head></p>
<p class="p1"><body></p>
<p class="p2"><br></p>
<p class="p1"></body></p>
<p class="p1"></html></p>
</body>
</html>
I copied and pasted your code into textmate saved the file as test.html and doubled clicked on it.
It worked perfectly. It seems like a browser issue, have you tried reinstalling them. How about try it on another computer? Is the file name end with .html?
how about
<html>
<head>
<title>Hi</title>
</head>
<body>
<p>Are you working?</p>
</body>
</html>
does that work?