HTML Flashcards
Where do you put non-visible content about the HTML document?
Within the head element
Where do you put visible content about the HTML document?
Within the body element
Where do the <head> and <body> tags go in a valid HTML document?
After the doctype declaration element and within the html element
What is the purpose of a <!DOCTYPE> declaration?
To let the browser know which version of HTML the page is formatted for
Give five examples of HTML element types
P, style, script, div, span
What is the purpose of the HTML attributes?
To give additional details about the content
Give an example of an HTML entity (escape character)
Escape characters allow you to use characters normally reserved for HTML coding, such as ® for ®
How do block-level elements affect the document flow?
These elements start on a new line
How do inline elements affect the document flow?
These elements continue on the same line
What are the default width and height of a block-level element?
Width is 100% and height is auto
What are the default width and height of an inline element?
They are both auto (fill in as much space as is necessary)
What tags are necessary for a complete HTML skeleton?
Bare minimum include: <!DOCTYPE>, <HTML>, <Head>, <title>, <body></title>
What kind of content belongs within the <head> of an HTML document?
Meta information about the page (ie, <title>, <style>, <meta></meta>, <link></link>)</style></title>
What type of content belongs within the <body> of an HTML document?
Contains all of the visible contents of the page (ie, <h1>, <p>, <img></img>, <table>, <input></input>, <list>)</list>
Where must the DOCTYPE declaration appear in a valid HTML document?
At the top to tell the browser immediately what version of HTML is on that page
Do all HTML elements require a closing tag?
No, some are self-closing, like <img></img>, <input></input>, <meta></meta> because they cannot contain content like other tags, like <h1> <p>
What are attributes for in HTML?
Specify additional details about elements, and specified in the opening tag, if at all
How do you know when to use an href attribute versus a src attribute?
Href is for linked resource of url (for linking things together like stylesheets or linking to specific pages with anchor elements
Src is for embedded information like css, html files, js files, images, and videos
What is the purpose of the alt attribute on <img></img> elements?
Provides text description of the image, in case the image cannot load for whatever reason(s) and useful for accessibility purposes for screen-readers
How many heading elements are available in HTML?
6 different levels for different sizes of headers
How do you link to a file in the same folder as the current HTML document?
src=”image.png”
How do you link to a file in a directory one level up from the directory containing the current HTML document?
src=”../image.png”
What is the difference between an absolute file path and a relative file path on the web?
An absolute file path is the full URL to a file and a relative file path is the link according to the current page.
What is a hyperlink?
HTML links are hyperlinks; you can click on them to jump around on a page or to a different page, image, or another HTML element
What is the difference between an ordered list and an unordered list in HTML?
Ordered lists display their items with sequential numbers and unordered lists display their items with bullet points
Is an HTML list a block element or an inline element?
Block
What HTML tag is used to link to another website?
<a></a>
What is an absolute URL?
The address to an external resource
What is a relative URL?
The address to a local resource
How do you indicate the relative link to a parent directory?
Using ../
How do you indicate the relative link to a child directory?
Using /
How do you indicate the relative link to a grandparent directory?
Using ../../
How do you indicate the relative link to the same directory?
Using ./
What is the purpose of an HTML form element?
To act as a boundary to encapsulate the beginning to the end of the form
Give five examples of form control elements
Action, method, autocomplete, name, target
Give three examples of type attribute values for HTML <input></input> elements
Button, radio, checkbox
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> <thead> <tbody> <tr> <td> <th>
</th></td></tr></tbody></thead></table>
What purpose do the thead and tbody elements serve?
Used in long forms to separate the header table content (ie, data type) from the body table content (ie, data)
Give two examples of data that would lend itself well to being displayed in a table
Test scores
Prices