How to start writing HTML

If you are beginning to code, HTML is a great place to start. But, there is a lot that needs to be done before you can actually dive into the coding. Many text editors have options for you to auto-fill with the basics, but it is important to know what all of this means. Here is the first essential element that is added to every HTML page.

<DOCTYPE html> helps define what language this whole page is going to be in. And that is why it is always at the top of every piece of HTML.

Next, you need to define what language you are speaking in. If you speak English, then right under you would type “en.” There are numerous languages supported by HTML such as:

Chinese : zh
English: en
French : fr
Irish: ga
ect.

After you have defined all of that, you can start to get into the real code. To begin this, you need to start with the head. This is usually where a lot of the code goes that does not have an appearance on your page. In the head, you will need to define your “charset.” For HTML, you use “<meta charset=”UTF-8>” This tells the computer which method of conversion is necessary to transform your code into machine-readable code.

This next one isn’t as necessary as the rest, but it is highly recommended. This is  <meta name=”viewport” content=”width=device-width, initial-scale=1.0″>. What does this long line of code mean? It basically helps make sure that the page you are coding will render to the size of your entire browser. 

If you have any additional code from CSS or JavaScript or the many other coding languages out there that you would like to add. Just type <link rel=”stylesheet” href=“name of file”> and it will be linked and will affect the entire page (if you do not have any extra code just skip this part).

And most importantly, you need to have a title. No one is going to know what your page is about without a title. So in the head you have to type <title> Your website name </title>. This shows up on your browser’s tab. 

After this, you are safe to close the head by typing </head>. Don’t worry, you can always go back and add to this later.

After the head, you can begin the fun stuff, the body. You start off by typing <body> and from there on, you can create your website. Just don’t forget to type the terminating attribute to both the body and the HTML.

Here is what the final product should look like

I hope we could help all you beginners out there. 

Here is a great resource we like to use: https://www.w3schools.com/ 

We wish you happy coding! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *