HTML Basics

1 Setup File

Here is the basic structure of every HTML file. We start with defining the doctype, in this case we are defining it as HTML5.

Then we open up some html tags and write a head and body tag. The head is where all the meta data, or info about your file goes. The body tag is where the content of your page goes.

<!DOCTYPE html>
<html>
    <head></head>
    <body></body>
</html>

2 Add some info in the head tag

Next we add a meta tag. Meta tags tell the browser about your file. The utf-8 meta tag defines the character encoding. The title tag determines what shows up in the tabs of your browser.

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Page Title</title>
    </head>

    <body></body>
</html>

3. Add some content inside the body tag

Now that we have a basic html file setup, we can start adding content inside the body tags.

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Page Title</title>
    </head>

    <body>
        <h1>Header Title</h1>
        <hr>
        <p>Lorem ipsum dolor sit amet, adipiscing, sed do eiusmodtempor incididunt</p>
    </body>
</html>

4. Starter File

Starting out, its a good idea to have an HTML starter file to avoid repeat typing all of this every time you make a new file.

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Page Title</title>
    </head>

    <body>
        <!-- code... -->
    </body>
</html>

results matching ""

    No results matching ""