How to run an HTML file: 12 steps (with pictures)

Table of contents:

How to run an HTML file: 12 steps (with pictures)
How to run an HTML file: 12 steps (with pictures)

HTML ("Hypertext Markup Language") is a language used to compose web pages. With HTML, you can organize your document, insert images, link to other pages, etc. Any file containing HTML instructions must be saved with an ".html" extension. Today's browsers (Google Chrome, Safari, Mozilla Firefox…) are all capable of executing files in this format.


Part 1 of 3: Save an HTML file

Run a HTML File Step 1

Step 1. Understand what HTML is

HTML is the abbreviation for "Hypertext Markup Language". HTML files are simple text files that contain lines of code that can be used to display web pages. To write an HTML file, you can take any text editor, even summary (Notepad, Notepad ++) or HTML editors. If you want to view your file, you have to run it on an Internet browser.

Run a HTML File Step 2

Step 2. Type or copy the HTML code in a text editor

Later, when you know how to program in HTML, you can use software such as Adobe Dreamweaver, Microsoft Expression Web or Coffee cup HTML. If you are a beginner, a simple text editor is more than sufficient. Notepad (Windows) or TextEdit (Mac) will do.

Run a HTML File Step 3

Step 3. Save your HTML file with an.html extension

In Notepad, TextEdit or any other editor, the file must be saved with a particular extension:.html. Before saving the file, edit the item File type (or similar name) by showing the mention All the files. Once done, click Save.

Part 2 of 3: run an HTML file

Run a HTML File Step 4

Step 1. You must have a browser on your hard drive

An HTML file can only be executed on a browser that supports this format.

Run a HTML File Step 5

Step 2. Find the file to run

If you know the file is in a folder, but you can't locate it, search your computer's search engine. Type.html in the search box at the bottom of the menu To start up (on Windows) or in the Finder search box (on Mac).

HTML files are in a folder that calls itself HTML, but without the.html extension. In this folder you can find.js (JavaScript),.css (style sheets) files, images, etc. Do not worry ! These are additional files that are created as you go, and which are used to display the page as you have defined it. Don't delete them! Leave them in the same directory (a folder in this case) as your HTML file, without which your page will not display correctly. To modify an HTML file, you must know how to program in HTML, or in another language

Run a HTML File Step 6

Step 3. Right click (Windows) or double click (Mac) on the file in question

Choose option Open with…. The list of all the browsers installed on your hard drive will then appear, the default browser being the first in the list. It's up to you which one you take: Google Chrome, Mozilla Firefox, Safari, etc.

  • On most computers there is a default browser. Concretely, this means that you do not have to search for a browser for this type of file - double click on the file in question and it will open with that browser by default.
  • If your computer cannot view the file, Windows will ask you which application to open it with. If nothing is suitable, you can search the Internet for an application by clicking on Find an app in the Windows Store. You can also click on Search for another application on this PC. In the list, you should find the browsers installed on your computer.
Run a HTML File Step 7

Step 4. View your HTML file in the browser

The latter then automatically reads the lines of code and, after interpretation, displays the content on the screen. In the address bar appears the path of the file - this is proof that the correct file has been opened, because its name appears at the end of the address.

Run a HTML File Step 8

Step 5. Another method: launch your browser, and press Ctrl-O. A selection window opens, find your file, double click on it and it will appear in a browser tab. Each browser having a keyboard shortcut for the function To open, it is advisable to consult the help to know what this macro is.

Part 3 of 3: Upload an HTML File to a Site

Run a HTML File Step 9

Step 1. Start an FTP platform

The three main operating systems (Windows, Mac OS, Linux) each have a native FTP client. Feel free to use them because they are easy to use, especially if you don't have a lot of files. Otherwise, you can use an FTP client, like FileZilla or Cyberduck.

Run a HTML File Step 10

Step 2. Then connect to the remote server

This is the website server. If you are using the native client for your operating system, don't worry about anything. You will have in front of you two frames on the left and as many on the right. Those on the top and on the left do not concern you directly. On the other hand, take care of the frame at the bottom right.

Run a HTML File Step 11

Step 3. Locate the HTML file to transfer and drag it into the frame

The download starts immediately. If you are using a native FTP client, locate the folder named "htdocs" (or by default "HTML") and click To download. You will then have to choose some options.

Don't use the shortcut! You will automatically create mirror pages and access links, which are very unnecessary here

Run a HTML File Step 12

Step 4. Quietly wait for the transfer to complete

Refresh the site and launch your site in a browser. Go to the newly created and loaded HTML page. If you enter an incomplete address of your site, you will see a directory appear, that of the sub-folder in question. Simply click on the HTML page (link in blue) that interests you.

Popular by topic