Write Your First HTML Page

Taylor Bell
InstructorTaylor Bell
Share this video with your friends

Social Share Links

Send Tweet
Published 5 years ago
Updated 3 years ago

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.

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.

egghead
egghead
~ 37 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today