Lesson 2 Home
HTML Elements and Tags
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 angled
brackets) to give the information they surround special meaning.
- Tags are often referred to as elements.
- Tags usually come in pairs. The opening tag denotes the start of a piece of content; the closing tag denotes the end.
- To learn HTML you need to know what tags are available for you to use, what they do, and where they can go.
- HTML elements are used to describe the structure of the page (e.g. headings, subheadings, paragraphs).
- They also provide semantic information (emphasis, strong importance)
Basic Elements
Yesterday, we learned about the html, head, title, body, and p tags. Let's review these individually.
- 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.
- p - This is a paragraph tag. Text will go between the two p tags (opening and closing) and will be displayed in the main browser window.By default, a browser will show each paragraph on a new line with some space between it and any subsequent paragraphs.
- em - element indicates emphasis that subtly changes the meaning of a sentence. By default browsers will show the contents of an em element in italics and screen readers will read them Differently
- strong - element indicates that its content has strong importance. For example, the words contained in this element might be said with strong emphasis. By default, browsers will show the contents of a strong element in bold.
Let's learn some new element types!