Create a HTML text file

A text file is a simple file with the extension .txt on the end

NOTE: A html file is just a text file with the extension changed from .txt to .html

Open the TextMate application
If you do not have the application on your machine then download it.(http://www.iskill.co.uk/teach/index.php/textmate/155-01-how-to-download-text-mate)

Menu: File / new
...or keyboard: APPLE + N

Menu:File/ save as...

Enter the name of your file but making the extension: .html
For example: myhtmlfile.html

Enter the following text into the text file

<!DOCTYPE html> <html> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> </body> </html>

View your html file in a browser

Select your file on the desktop

Right click and select 'open with...' and choose 'Safari'

Quickly preview your html

CTL + ALT + cmd + P

A new window should appear showing the browser version of your HTML code