HTML stands for Hyper Text Markup Language. It allows you to place links, text, images, and more. Let’s start off with setting up our file.
Your index.html file should be empty. Let’s get our file setup. Type in the below:
<!doctype html> <html> <head> <title>My First Website</title> </head> <body> </body> </html>
The first line tells the browser to start reading the file as HTML. It basically says Document Type is HTML. Whenever you write html, we create open and close tags. <html> opens the html file, and </html> closes the html file, showing where all the code ends.
The <head> opens what is known as the header. In the header, we can add favicons, and different packages to use. Inside of the header, we put <title> which gives use a tab title. The title says My First Website. After closing the title, we close the header. Whatever we put in the header will not be on the physical page. After the header, we open the body, like this: <body>. Everything that goes into here will show up on the page. Below, we will add text to the page.
There are many different ways to write text in HTML. We are going to be focusing on the main ways right now.
To write in paragraph text, open <p> and write what you want. Here is an example below.
<p>This is my first paragraph!</p>
There are also headings, which is different than the header. There are 6 different types, shown below.
<h1>Heading 1</h1> <h2>Heading 2</h2> <h3>Heading 3</h3> <h4>Heading 4</h4> <h5>Heading 5</h5> <h6>Heading 6</h6>
And with that, you know the basics to types of text in HTML. Next, we will add links and images to our page.