top of page
tag gif.gif

TAGS

  1. The basic structure of an HTML document includes tags. 
     

  2. Tags surround content and apply meaning to it.
     

  3. Tags are contained within angle brackets or carets: <>

We're going to add a few basic tags to our document: 

<!DOCTYPE html>

This is a document type declaration that lets your web browser know which version of HTML you're using. 
 

It is self-closing since it doesn't nest any content in between it. 

<body> </body>

Whatever lies between the <body> and </body> is the main content of the document that will appear in the browser window.

<html> </html>

The <html> tag alerts the browser that everything that lies in between it and </html>  forms an HTML document. 

Screen Shot 2021-08-25 at 6.13.44 PM.png
  1. Once you run this code, you'll see that nothing changes. 
     

  2. This is because the purpose of HTML is to apply meaning, not presentation, and this example has now defined 3 fundamental elements of a web page:
     

    • The version of HTML you're using

    • The main content of the page defined by the body tags

    • The fact that this is an HTML document​

element.png

ELEMENTS

  1. Elements are what make up web pages.
     

  2. Tags are a part of an element. 
     

  3. For example: everything that is in between (and includes) the <body> and </body> tags is the body element.

Screen Shot 2021-08-25 at 6.13.44 PM.png
bottom of page