Create a file named helloworld.txt and open it in notepad or your favorite text editor.
NOTE: The .txt extension is very important. Only programs that save pure text should open this file format, and they should save it correctly. The .txt file extension is for a file that contains only plain text with no styling or formatting (much like this site!).
Put the below code into the text file and save it
<h1>Hello World!</h1>
<p>This is my first website!</p>
Rename your file to helloworld.html and open it. Your browser should launch and you should see a very simple website. We could have started with this file ending in .html, but you would have had to right click it and open it with a different program. This is because .html files open in the browser by default.
You just did three things. You used HTML to create two elements using the tags <h1> and <p>. Click the three links to read about HTML, elements, and tags.
Note: At any time you can view the source code for this website. In Safari go to Safari - Settings - Advanced - "show features for web developers". Then you can click the develop tab and select "show web inspector." In most Chromium browsers (Brave, Chrome, Edge, etc) you can go to view - developer - "developer tools". If that doesn't work, just google how to view page source for the browser you are in.
Elements are pretty basic. However, you can provide additional functionality to an element with attributes. Let's modify our example.
<h1>Hello World!</h1>
<p>This is my first website!</p>
<img src="https://media.defense.gov/2006/Aug/10/2000546077/700/700/0/060810-F-JZ506-397.JPG" />
img on its own doesn't do much. It needs the attribute `src` to know where to find the image. You will also notice that the img tag self closes. It doesn't need a second tag to close it because there is no text needed between the opening and closing tag, unlike h1 and p.
Here is a short reading on attributes, then you can read about html basics.
This website sure is ugly... we need to make it better. Click here to start with CSS!