Become a member
to unlock all features

    Write Your First HTML Page

    Taylor BellTaylor Bell
    htmlHTML 5

    In less than two minutes, this lesson will teach you how to create a barebones html file, with only a title and a single line of content.



    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson


    Instructor: 00:00 When we go to create our first HTML document, at the top we have the DOCTYPE declaration. We write that by doing a bracket and an exclamation point, DOCTYPE in all capital letters and html in lower case letters and then we close the bracket.

    00:17 Now below that is where we open what's called our HTML tag. One of the things that I like to do is when I write an HTML tag, I'll add the closing tag right away and then move the cursor around to add space in between. This is the basic structure of every HTML document that we'll write.

    00:33 Now that's we moved over a little bit, one of the things that every HTML document needs is a head section. We'll do our bracket, write the word Head, remember to close it, move back over, and now we're indented again.

    00:45 The head of the HTML document contains lots of information about the page, but for now, we're just going to set the title. We'll open our title tag. Since we'll do this on one line, I am not going to make the closing tag yet. We'll just set this as My First Page and then close our title tag.

    01:03 Just like with most people, below the head we have a body. We'll open our body tag and write a closing tag to match, space everything over. Now inside of the body is where the content will go. We'll just write Content Here.

    01:19 Now this might not look like much, but you've just created your first web page. To prove it, we'll save this file. I'm going to call it index.html. This is the file name that most Web servers expect to be the default of a page. We hit save.

    01:33 Again, even though we've written plain text, we want to save this as HTML because this is what tells our browser what to display. I'm going to hit Use HTML.

    01:42 Now when I look inside of the file directory, here's my index.html file. If I double-click it, it will open in a Web browser, and here's the content here that we set. You've just created your first web page.