curriculum/challenges/english/blocks/review-html/671a883163d5ab5d47145880.md
Review the concepts below to prepare for the upcoming prep exam.
<h1></h1>, <p></p>).head and body, where metadata, styles, and content are structured.<h1> - <h6>), paragraphs (<p>), and div containers (<div>).div elements: The div element is a generic HTML element that does not hold any semantic meaning. It is used as a generic container to hold other HTML elements.& and <.link element: Linking to external stylesheets.script element: Embedding external JavaScript files.DOCTYPE, html, head, and body elements. It should be used as the starting point for an HTML document.description): Providing a short description for the web page and impacting SEO.<iframe>: Integrating external video content./, ./, ../ for file navigation.href="#id" on an a element and giving the destination element the same id.h1 element is the highest level of heading and the h6 element is the lowest level of heading.center, big, and font elements.<header>: Represents introductory content.<nav>: Contains navigation links.<article>: Represents self-contained content.<aside>: Used for sidebars or related content.<section>: Groups related content within a document.<footer>: Defines the footer for a section or document.em) element: Marks text that has stress emphasis.i) element: Used for highlighting alternative voice or mood, idiomatic terms from another language, technical terms, and thoughts.strong) element: Marks text that has strong importance.b) element: Used to bring attention to text that is not important for the meaning of the content.dl) element: Used to represent a list of term-description groupings.dt) element: Used to represent the term being defined.dd) element: Used to represent the description of the term.blockquote) element: Used to represent a section that is quoted from another source.q) element: Used to represent a short inline quotation.abbr) element: Used to represent an abbreviation or acronym.address) element: Used to represent the contact information.time) element: Used to represent a date and/or time.sup) element: Used to represent superscript text.sub) element: Used to represent subscript text.code) element: Used to represent a fragment of computer code.u) element: Used to represent a span of inline text which should be rendered in a way that indicates that it has a non-textual annotation.ruby) element: Used to represent the text of a ruby annotation.s) element: Used to represent content that is no longer accurate or relevant.form element: Used to create an HTML form for user input.text, email, password, radio, checkbox, number, date.action attribute: used to specify the URL where the form data should be sent.method attribute: used to specify the HTTP method to use when sending the form data. The most common methods are GET and POST.<form method="value-goes-here" action="url-goes-here">
<!-- inputs go inside here -->
</form>
input element: used to create an input field for user input.type attribute: used to specify the type of input field, e.g., text, email, number, radio, checkbox.placeholder attribute: used to show a hint to the user to show them what to enter in the input field.value attribute: used to specify the value of the input. If the input has a button type, the value attribute can be used to set the button text.name attribute: used to assign a name to an input field, which serves as the key when form data is submitted. For radio buttons, giving them the same name groups them together, so only one option in the group can be selected at a time.size attribute: used to define the number of characters that should be visible as the user types into the input.min attribute: can be used with input types such as number to specify the minimum value allowed in the input field.max attribute: can be used with input types such as number to specify the maximum value allowed in the input field.minlength attribute: used to specify the minimum number of characters required in an input field.maxlength attribute: used to specify the maximum number of characters allowed in an input field.required attribute: used to specify that an input field must be filled out before submitting the form.disabled attribute: used to specify that an input field should be disabled.readonly attribute: used to specify that an input field is read-only.:::interactive_editor
<!-- Text input -->
<input
type="text"
id="name"
name="name"
placeholder="e.g. Quincy Larson"
size="20"
minlength="5"
maxlength="30"
required
/>
<!-- Number input -->
<input
type="number"
id="quantity"
name="quantity"
min="2"
max="10"
disabled
/>
<!-- Button -->
<input type="button" value="Show Alert" />
:::
label element: used to create a label for an input field.for attribute: used to specify which input field the label is for.label element.:::interactive_editor
<form action="">
<label>
Full Name:
<input type="text" />
</label>
</form>
:::
for attribute on the label element.:::interactive_editor
<form action="">
<label for="email">Email Address: </label>
<input type="email" id="email" />
</form>
:::
button element: used to create a clickable button. A button can also have a type attribute, which controls the behavior of the button when it is activated, e.g., submit, reset, button.:::interactive_editor
<button type="button">Show Form</button>
<button type="submit">Submit Form</button>
<button type="reset">Reset Form</button>
:::
fieldset element: used to group related inputs together.legend element: used to add a caption to describe the group of inputs.:::interactive_editor
<!-- Radio group -->
<fieldset>
<legend>Was this your first time at our hotel?</legend>
<input id="yes-option" type="radio" name="hotel-stay" value="yes" />
<label for="yes-option">Yes</label>
<input id="no-option" type="radio" name="hotel-stay" value="no" />
<label for="no-option">No</label>
</fieldset>
<!-- Checkbox group -->
<fieldset>
<legend>
Why did you choose to stay at our hotel? (Check all that apply)
</legend>
<input type="checkbox" id="location" name="location" value="location" />
<label for="location">Location</label>
<input type="checkbox" id="price" name="price" value="price" />
<label for="price">Price</label>
</fieldset>
:::
thead) element: used to group the header content in an HTML table.tr) element: used to create a row in an HTML table.th) element: used to create a header cell in an HTML table.tbody) element: used to group the body content in an HTML table.td) element: used to create a data cell in an HTML table.tfoot) element: used to group the footer content in an HTML table.caption element: used to add a title of an HTML table.colspan attribute: used to specify the number of columns a table cell should span.:::interactive_editor
<table>
<caption>Exam Grades</caption>
<thead>
<tr>
<th>Last Name</th>
<th>First Name</th>
<th>Grade</th>
</tr>
</thead>
<tbody>
<tr>
<td>Davis</td>
<td>Alex</td>
<td>54</td>
</tr>
<tr>
<td>Doe</td>
<td>Samantha</td>
<td>92</td>
</tr>
<tr>
<td>Rodriguez</td>
<td>Marcus</td>
<td>88</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="2">Average Grade</td>
<td>78</td>
</tr>
</tfoot>
</table>
:::
th element to define header cells and the td element to define data cells. This helps assistive technologies understand the structure of the table.label element to associate labels with form inputs. This helps assistive technologies understand the purpose of the input.alt text: You should use the alt attribute to provide a text alternative for images. This helps assistive technologies understand the content of the image.tabindex attribute: Used to make elements focusable and define the relative order in which they should be navigated using the keyboard. It is important to never use the tabindex attribute with a value greater than 0. Instead, you should either use a value of 0 or -1.accesskey attribute: Used to define a keyboard shortcut for an element. This can help users with mobility impairments navigate the website more easily.role="tab", role="menu", and role="alert".aria-label and aria-labelledby attributes: These attributes are used to give an element a programmatic (or accessible) name, which helps assistive technology (such as screen readers) understand the purpose of the element. They are often used when the visual label for an element is an image or symbol rather than text. aria-label allows you to define the name directly in the attribute while aria-labelledby allows you to reference existing text on the page.aria-hidden attribute: Used to hide an element from assistive technologies such as screen readers. For example, this can be used to hide decorative images that do not provide any meaningful content.aria-describedby attribute: Used to provide additional information about an element by associating it with another element that contains the information. This helps assistive technologies understand the purpose of the element.Review the HTML topics and concepts.