HTML Flashcards
What is the root tag of an HTML file?
<html></html>
<body>
</body>
Represents the content of an HTML document.
There can be only one <body> element in a document.
<html>
</html>
The <html> HTML element represents the root (top-level element) of an HTML document, so it is also referred to as the root element. All other elements must be descendants of this element.
<a> Matt </a>
A link tag reading Matt that takes you to matt.com
<div>
</div>
A general tag to separate content from each other
<form>
<input></input>
<button>Button</button>
</form>
Creates an input field where you can type, and a button reading Button, that when clicked goes to another-age.html
HTML element
the concept of the everything from the open tag, all the content, all the way to the close tag.
Empty element
An element with only an open tag, and no content
id attribute
gives each element a unique identifier to be selected with CSS
Each value for the “id” attribute must be unique across the entire HTML document.
class attribute
assigns an element to a class to be selected with CSS or JavaScript
Classes are meant to be applied to more than one element.
title attribute
gives a cool hover feature that displays text over an element
Absolute vs Relative link
Absolute links are generally used to send readers of your Web site to another Web site. For example, https://appacademy.io is an absolute link because it starts with “http://” or “https://”.
Relative links do not start with “http://” or “https://”. Instead, they’re like relative paths with respect to the file system.
<a> Absolute Link</a>
<a> Relative Link</a>
Header tags
There are six levels of headers, each represented by a different tag: h1, h2, h3, h4, h5, and h6.
Always structure your tags to have the next larger tag before it.
img tag required attributes
src=the link to the image
alt=the text to be shown if image is unavailable
<head>
</head>
contains machine-readable information (metadata) about the document, like its title, scripts, and style sheets.
<link></link>
specifies relationships between the current document and an external resource. This element is most commonly used to link to stylesheets, but is also used to establish site icons (both “favicon” style icons and icons for the home screen and apps on mobile devices) among other things.
<title>
</title>
defines the document’s title that is shown in a browser’s title bar or a page’s tab.
<footer>
</footer>
represents a footer for its nearest sectioning content or sectioning root element. A footer typically contains information about the author of the section, copyright data or links to related documents.
<header>
</header>
element represents introductory content, typically a group of introductory or navigational aids. It may contain some heading elements but also a logo, a search form, an author name, and other elements.
<main>
</main>
represents the dominant content of the body of a document. The main content area consists of content that is directly related to or expands upon the central topic of a document, or the central functionality of an application.
nav
represents a section of a page whose purpose is to provide navigation links, either within the current document or to other documents. Common examples of navigation sections are menus, tables of contents, and indexes.
section
represents a standalone section — which doesn’t have a more specific semantic element to represent it — contained within an HTML document.
<li>
</li>
<li> is used to represent an item in a list.
</li>
<ol> and <ul>
</ul></ol>
<ol> represents an ordered list of items — typically rendered as a numbered list.
<ul> represents an unordered list of items, typically rendered as a bulleted list.
</ul></ol>