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.