Understanding HTML code and how to work with it can go a long way. You can use it in your day to day work, such as creating HTML signatures to make your email communication more professional. Another unusual but convenient way to use HTML is to save web pages to Word documents.
However, all of this can be a little confusing if you’ve never worked with an HTML file before. Let’s start from the beginning by learning what these files are and how to open and view an HTML file in Chrome.
What is an HTML file?
HTML stands for Hypertext Markup Language and is an Internet-based scripting language. Its main purpose is to create and structure web pages. Files with the HTML (or HTM) extension contain only text and links to other files such as images or videos.
There are many different programs you can use to create and edit your HTML file. However, you can use any simple text editor to open and read it as text. If you want to see what a web page looks like, you need to run this HTML file using a web browser.
Google Chrome recognizes HTML and you can use it to open any file with the “.html” extension.
How to open an HTML file in Chrome
There are several ways to open an HTML file in Chrome.
Use the Open With command
- Find the HTML file you want to view, right-click it and choose Open With from the menu. You will see a complete list of applications that can be used to run the file. Your default browser will be at the top of the list.
- Select Google Chrome from the list and view the file in a browser.
- If Google Chrome is set as the default browser, all you have to do is double-click the HTML file and it will automatically open in Chrome. If you tried this and found that your computer does not recognize your file, the system will ask you to use one of the already installed applications to open the file, or search for the extension on the Internet. Select Open with already installed applications. Then try selecting Google Chrome from the list again.
- To make sure you have the correct HTML file, check the address bar in Chrome when it opens the page. It should match the location of your file on your computer.
Open HTML file from Chrome
If you already have a browser, you can open the HTML file in Chrome without having to first search for it on your computer.
- Choose File from the Chrome ribbon menu. Then select “Open File”.
- Navigate to the folder with the HTML file, select the document and click Open.
- You will see your file open in a new tab.
You can also use a keyboard shortcut to open the file in Chrome. Open a new tab in Chrome, then press Ctrl (Windows) or Cmd (Mac) + O. The same Open File menu appears. Find your HTML file and open it.
If the shortcut didn’t work, your browser may have a different set of hotkeys for this command. You can always check this in your browser settings. There are many different functions that you can use with keyboard shortcuts in Google Chrome. You can learn how to switch between tabs, create Google Calendar events, and even faster to turn Incognito Mode on and off with the right shortcuts.
Drag and drop the file into Chrome
You can also just drag the HTML file directly to the new tab. Then Chrome will automatically open the page.
How to view the original HTML
If you need to do a little more than just view the page, but also view the HTML source, Chrome lets you do that as well.
There are several ways to do this. The easiest is to open the HTML file in a new tab in Chrome. Then right-click it and choose View Page Source from the menu.
If you want a more interactive tool and want to see at a glance how the changes you make will affect a web page, you can use the Chrome developer tool.
To do this, open the HTML file in a new tab. Then click the icon with three vertical dots in the upper right corner of the window. From the drop-down menu, select More Tools> Developer Tools.
On the right side of the screen, click the Elements tab to see the detailed source code for your web page.
How to open an HTML file from your smartphone
If you are using a smartphone, you can also use various methods to open the HTML file in Chrome.
Use the Open With menu
Find the HTML file you want to open on your phone and click on it. The “Open With” menu opens, where you can choose from a list of applications that you can use to view the web page. Select Chrome to open the file.
Open HTML file from SD storage
Launch the Chrome browser on your phone and open a new tab. Enter file: /// sdcard / in the address bar and your SD storage will open. From there, navigate to the file you want to open and click to view it.
Learn how to understand HTML
Learning small tricks and a better understanding of HTML can give you more freedom when working with both code and text. One good example is learning how to embed HTML in a Google document, among other things.
Have you ever worked with HTML files? Is it difficult for you? Share your experience with us in the comments below.