HTML Flashcards
Where do you put non-visible content about the HTML document?
Between the head element opening and closing tags.
<head>
</head>
Where do you put visible content about the HTML document?
Between the body element opening and closing tags.
<body>
</body>
Where do the <head> and <body> tags go in a valid HTML document?
Between the doctype declaration and the HTML element opening and closing tags.
<!DOCTYPE html>
<html>
</html>
What is the purpose of a <!DOCTYPE> declaration?
Tells the browser what type of document is being declared/which version of HTML is being used
Give five examples of HTML element types.
HTML, head, body, p, h1-h6, title
What is the purpose of HTML attributes?
Provides information about the content of an element
Give an example of an HTML entity (escape character).
Ampersand = &
accent on e = é
How do block-level elements affect the document flow?
They create elements that will start on a new row and use the entirety of the row (horizontal space)
How do inline elements affect the document flow?
- Appears on the same line as their neighboring elements.
- Depending on the element they can manipulate the style of text content
What are the default width and height of a block-level element?
- Occupies the entire horizontal space of its parent element and height of its content
- The default height is the height of the content and the width is the entire length of the page
What are the default width and height of an inline element?
The default height and width is the height of the content and the width of the content
What is the difference between an ordered list and an unordered list in HTML?
Ordered lists are numbered (alphabetical, etc.) and unordered lists begin with a bullet point (squares, etc.)
Is an HTML list a block element or an inline element?
Block element
What HTML tag is used to link to another website?
Anchor tag and href attribute
<a> </a>
What is an absolute URL?
The full web address of a site to visit a specific page
(domain name for that site, followed by the path to a specific page)
Using anchor tags
What is a relative URL?
Links to other pages within the same site
(shorthand versions because they do not need the domain name)
Using directory pathway
How do you indicate the relative link to a parent directory?
Use ../ to indicate the folder above the current one, then the file name
<a href= “../index.html”>
How do you indicate the relative link to a child directory?
Name of child folder, followed by forward slash, then the file name
<a href= “ child/child.html “ >
How do you indicate the relative link to a grand parent directory?
You can use ../ as many times to reach the root directory/grandparent directory
<a href=”../../filename.html”>
What is the purpose of an HTML form element?
- The form element identifies the webpage as a form in which a user can input information
- ex) login page, sign up form, subscription page
- Collects information and is sent to a server
Give five examples of form control elements.
Input, label, select, button, option
Give three examples of type attribute values for HTML <input></input> elements.
Radio, checkbox, email, submit, time, calendar
Is an HTML <input></input> element a block element or an inline element?
Inline
What are the six primary HTML elements for creating tables?
Table, tr, td, th, tbody, thead, (optional: tfoot)