The flat-out simplest way to serve the page (rather than opening a file) is, using the command line, to run a server in the folder with your files.
Lots of languages come with servers in their standard library. Python is common: if you have a Mac, or a Hewlett-Packard Windows machine, or you’re running Linux, you should already have Python. Needs to be downloaded and installed otherwise (download for your system here).
Once you have Python installed, open a terminal program on your computer. If you haven’t used the command line before, you’re looking for a program called Terminal if you’re on a Mac, on Windows a program called Command Prompt (If you have used the comand line, you’re probably not using either of those programs and you know what you’re doing already). Anyway:
First, check Python is installed - type this command:
And hit enter. It should return a single line with the current version of Python installed - mine says
Then, using the command line, navigate to the directory with your files. To do this, you use
cd (change directory) followed by the path to the folder (note you can check where you currently are by typing
pwd on Mac/Linux, or
echo %cd% on Windows).
When you hit enter there, you’re in the project directory. Type
python -m SimpleHTTPServer
It should hang for a second or two, then give you the message
Serving HTTP on 0.0.0.0 port 8000 ....
Open http://127.0.0.1:8000 in the browser. If there is an index.html, that will be the default file served, otherwise you should get a directory listing of all the available files being served.
Note this works in a number of other languages/environments: see https://gist.github.com/willurd/5720255