2. HTML Fundamentals Flashcards
In HTML, a(n) ____ indicates an element’s starting point in the document
opening tag
In HTML, a(n) ____ indicates an element’s ending point in the document
closing tag
A(n) ____ element is an element that only needs an opening tag.
void (e.g., <br>, <img>
According to WHATWG, what are the minimal parts of an HTML document?
<!DOCTYPE html>
<html>
<head>
<meta>
<title>
<body>
What HTML declaration instructs the browser about what type of document follows?
<!DOCTYPE html>
What does <html lang="en"> indicate?
That the document’s language is English
What element contains the document title, document metadata, and various other elements that are typically not displayed in the webpage
<head>
Which HTML element specifies metadata, which is data that describes the document’s data?
<meta>
What does <meta charset=”UTF-8”> mean?
It describes how characters are represented in the HTML document
Which HTML element specifies the document’s name?
<title>
Which HTML element encloses all elements and content to be rendered in the browser?
<body>
An element ____ provides additional information about the element and is included only in the opening tag.
attribute
____ mode is a browser rendering mode that renders a webpage using non-standard layout rules emulating older web browsers. A webpage with the DOCTYPE is rendered using ____ mode, which uses the HTML Living Standard.
Quirks, standards
Which HTML element creates a paragraph in an HTML document?
<p></p>
Which HTML element creates a line break in a paragraph, such that the content after the line break appears on a new line?
<br> (a void element)
**Use <br> when the line break is essential to the content, such as lines in a poem or mailing address, and not just to add spacing for formatting a webpage. CSS should be used for formatting a webpage.
Which HTML element indicates a group of related content in a document?
<section></section>
How many levels of section headers are there in HTML?
6: <h1>, <h2>, etc.
HTML header tags should match the document’s ____ and not be selected only for their font size.
hierarchical
Which HTML element indicates emphasized text, such as text having an emphasized pronunciation when spoken, and is italicized by default?
<em></em>
Which HTML element indicates text that has strong importance, and is bolded by default?
<strong></strong>
Which HTML element denotes a title, such as a book or song title, and is italicized by default?
<cite></cite>
Which HTML element denotes important content that should be semantically highlighted and is rendered with a yellow background by default?
<mark></mark>
Which HTML element indicates text that needs attention, like key words in a document abstract or product names in a review, and renders the text in bold?
<b></b>
Which HTML element indicates text in an alternative voice, such as a word or phrase in a foreign language, and is rendered using italics?
<i></i>
Which HTML element denotes text that should appear differently from normal text, such as misspelled words, and is underlined by default?
<u></u>
Which HTML element denotes a variable in a computer program?
<var></var>
Which HTML element indicates keyboard input?
<kbd></kbd>
Which HTML element indicates computer code?
<code></code>
Which HTML element indicates sample output from a computer?
<samp></samp>
How do you insert a comment in HTML?
<!– Comment –>
Which HTML element indicates an unordered list?
<ul></ul>
Which HTML element indicates the list items in an ordered or unordered list?
<li></li>
Which HTML element indicates an ordered list?
<ol></ol>
What attribute, added to the <ol> element, indicates the ordered list’s numbering scheme?
type
<ol type=”1”></ol>
<ol type=”A”></ol>
<ol type=”a”></ol>
<ol type=”I”></ol> (Uppercase Roman numerals)
<ol type=”i”></ol> (Lowercase Roman numerals)
Which CSS property provides the ability to change the bullet used in an unordered list and offers more numbering options in an ordered list?
list-style-type
E.g.,
<ul style=”list-style-type:square”></ul>
<ol style=”list-style-type:lower-greek”></ol>
A list within a list item of another list is called a(n) ____ list.
nested
What HTML tag creates a table that organizes data into rows and columns?
<table></table>
Which HTML element indicates a table row?
<tr></tr>
Which element creates a table cell containing table header information about the data?
<th></th>
Usually, the browser displays table headers centered with a bold font
Which element creates a table cell containing table data?
<td></td>
Which HTML element defines a short descriptive text for a table and must immediately follow the opening <table> tag?
<caption></caption>
The <th> element allows for a(n) ____ attribute, which specifies whether the header applies to a “row” or a “col”
scope
<td> and <th> elements can use the ____ or ____ attributes to indicate that the cell covers more than one row or more than one column
colspan, rowspan
What HTML element specifies the header section in a table (not just a cell in the header section)?
<thead></thead>
What HTML element specifies the body of a table?
<tbody></tbody>
What HTML element specifies the table footer?
<tfoot></tfoot>
What HTML element displays an image on a web page?
<img> (void element)
What are the two required attributes for the <img></img> element?
src - specifies the URL of the image file to display
alt - provides a text description to use as an alternative to displaying the image
An image’s ____ ratio is the ratio of the image width to the image height
aspect
If an <img></img> contains only a width or only a height attribute, the image’s aspect ratio is ____.
maintained
Which image format is commonly used for digital photographs?
JPEG
Which image format is commonly used for line art, screenshots, or images requiring transparency?
PNG
Which image format is commonly used for simple animated images?
GIF
Which image format(s) use(s) lossy compression, meaning that some of the original picture information is lost when compressed?
JPEG
(humans cannot easily perceive the quality loss in a photograph)
Which image format(s) use(s) lossless compression, meaning that no image quality is lost.
PNG and GIF
(Lossless compression works best when a large number of adjacent pixels are the same color)
Which image format(s) can display true color (24-bit color), which is approximately 16 million different colors?
JPEG and PNG
Which image format(s) is/are limited to 256 colors (8-bit color)?
GIF
(GIF images can display animations, which are popular on social media)
Which image format(s) can have transparent pixels?
PNG
A ____ is a small icon that identifies a website and typically displays in a browser tab.
favicon
A favicon is defined with what HTML element?
<link>
Which HTML element defines a hyperlink in a webpage?
<a></a>
Which attribute, when added to the anchor element, specifies the hyperlink’s URL?
href
How do URLs begin if they are downloading a data file over the internet?
ftp://
E.g., ftp://example.com/index.html
How do URLs begin if they are opening a file from the user’s computer?
file://
E.g., file:///C:/example/index.html
How do URLs begin if they are opening an email app to compose an email?
mailto:
E.g., mailto:person@example.com
A(n) ____ URL is a complete URL.
absolute
A(n) ____ URL specifies the path to the web resource with no scheme or hostname.
relative
You can use a(n) ____ in an HTML element like <section> to allow for a URL to link to a fragment by using the hash symbol.
id
An anchor element’s ____ attribute indicates how the browser should display the link when clicked.
target
The ____ target attribute value in an anchor element is the default and indicates the browser will open the link in the same tab or window.
_self
The ____ target attribute value in an anchor element indicates the browser will open the link in a new tab or window.
_blank
A(n) ____ is a mechanism for writing special characters or symbols in HTML, such as mathematical symbols, characters in most languages, and many other symbols.
entity
Many HTML entities can be specified by name (e.g., ©). Others can be specified by decimal or hexadecimal number.
The < character normally marks the beginning of a tag, so ____ is used to display the < character when < is not part of a tag
<
The & character marks the beginning of an entity name, so ____ is used to display the & character when & does not start an entity name
&
A ____ space looks like a single space but acts like a normal character in the middle of a word, allowing for two words to be treated as one word
non-breaking
The entity name for a non-breaking space is