HTML Home
HTML Part 2
Let's begin part 2 of our HTML discussion with a review. HTML elements are typically comprised of two tags. Tags are like containers for content. These tags surround the content they describe. Opening tags start with a less-than symbol, the element name and then the greater-than symbol. Closing tags start with a less-than symbol, then a slash, then the element name and then the greater-than symbol.
Summary
- HTML pages are text documents.
- HTML uses tags (characters that sit inside less than and greater than symbols) to give the information they surround special meaning.
- HTML elements are used to add content and describe the structure of the page (e.g. headings, subheadings, paragraphs).
- They also provide semantic information (emphasis, strong importance)
- Tags usually come in pairs. The opening tag (< some element >) denotes the start of a piece of content; the closing tag (< / some element >) denotes the end.
- Some elements are self-closing, and only require an opening tag (eg images and line breaks)
- Complete tags (opening and closing or self-closing) are referred to as elements.
Basic Elements
In the previous section, we learned about the html, head, title, body, headings level 1-6, ordered and unordered lists, and p tags. Let's review these individually.
- DOCTYPE - Although most HTML will work without this tag, it is best practice to incorporate an HTML declaration at the start of your HTML file. This alerts the browser about what document type to expect, and prevents certain errors.
- html - This element goes at the beginning of every HTML page. It is closed with /html when you're finished with the file
- head - This part of the file will contain information like the site's title, and any additional files you want to use, like CSS or javascript.
- title - This is the title of your webpage. The title tag, and it's closing tag, are between the head and the /head tags. Your screen reader will read the title of a page when it loads, but it is not displayed on the screen. The contents of the title element are either shown in the top of the browser, above where you usually type in the URL of the page you want to visit, or on the tab for that page (if your browser uses tabs to allow you to view multiple pages at the same time).
- body - The body contains the content you will read off the screen. It is where you will put the majority of your content, text, audio, video, images, links, and so on. Everything inside this element is shown inside the main browser window.
Basic Elements Shell
<!DOCTYPE html>
<html>
<head>
<title> <title>
</head>
<body>
</body>
</html>
Next: Review of other useful element types!