syntax is a set of rules for or an analysis of the syntax of a language.
An HTML element is defined by a start tag, some content, and an end tag:
<tagname>Content goes here...</tagname>
The HTML element is everything from the start tag to the end tag:
<h1>My First Heading</h1>
<p>My first paragraph.</p>
The <!DOCTYPE html> declaration defines that this document is an HTML5 document
The <html> element is the root element of an HTML page
The <head> element contains meta information about the HTML page
The <title> element specifies a title for the HTML page (which is shown in the browser's title bar or in the page's tab)
The <body> element defines the document's body, and is a container for all the visible contents, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
The <h1> element defines a large heading
The <p> element defines a paragraph
The <meta> tag is for search engines and crawlers
Rules to remember, you will generally open your tag and close your tag and your content will be between the tags.
The tags act as identifiers for the content.
Content can be text, javascript or script or styling. Depending on what you want your objects to do will depend on the tagging correspondence.
Generally speaking computer languages all follow some sort of syntax. This process allows for processes to be duplicatable and without the need for repetitive hard coding configurations.
When learning a computer language try to understand the syntax for the language and then the pattern for how to implement the code in your code base. This will make more since as we progress through the lessons.
Now it's your turn
Open your notepad and update your code to include each of the tags that you see above.
Make sure you update your tags like the sequence you see in the images. Try each of the headings and see what it looks like on your page.
Tags act like a hierarchy sort of like a sideways pyramid, this is to help humans to identify the relationships of the content on the page.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
The <!DOCTYPE> Declaration
The <!DOCTYPE> declaration represents the document type, and helps browsers to display web pages correctly.
It must only appear once, at the top of the page (before any HTML tags).
The <!DOCTYPE> declaration is not case sensitive.
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>