HTML Flashcards
Where do you put non-visible content about the HTML document?
In the head element. Usually the metadata, script tag, stylesheet, and title.
Where do you put visible content about the HTML document?
In the body element.
Where do the head and body tags go in a valid HTML document?
They go in between the HTML element.
What is the purpose of a !DOCTYPE declaration?
It tells the web browser what version of HTML to use.
Give five examples of HTML element types.
P, head, body, div, and h1
What is the purpose of HTML attributes?
To customize HTML elements.
Give an example of an HTML entity (escape character).
Two examples are the copyright (©) and registered (®) signs. HTML entities are written with the ampersand(&) and some text.
How do block-level elements affect the document flow?
Each block level element appears on a new line. They are laid out vertically and take the full width of the page. Their vertical distance from other elements is determined by margins.
How do inline elements affect the document flow?
Inline elements only take the space they need in their parent element. They don’t appear on new lines.
What are the default width and height of a block-level element?
Default width: full-length of the page or value of “auto”
Default height: height of the text content
What are the default width and height of an inline element?
Default width: the width of the text content
Default height: the height of the text content
You can’t set the height and width of an inline element. You’d have to make them a block or inline block element first.
What is the difference between an ordered list and an unordered list in HTML?
Ordered list: numbered
Unordered list: bullet points
Worth noting that the “li” tag stands for list item.
Is an HTML list a block element or an inline element?
Block element
What HTML tag is used to link to another website?
The anchor tag or “a” html element.
What is an absolute URL?
The full URL as someone would type it in the search bar. It includes the protocol, the domain, etc.
What is a relative URL?
Navigation within your own webpage. It usually looks more like a file path than a link.
How do you indicate the relative link to a parent directory?
Syntax = ../filename
*You have to go to the directory above then specify the file name
How do you indicate the relative link to a child directory?
Syntax = directoryName/filename
*You have to give the directory name of the child directory then specify the file name
How do you indicate the relative link to a grand parent directory?
Syntax = ../../filename
*You have to go up two directory, so repeat (../) twice and then specify the file name
How do you indicate the relative link to the same directory?
Syntax = image-section.html
*Just use the file name
What is the purpose of an HTML form element?
All the form elements for the related content that a user can input.
Give five examples of form control elements.
Select, option, textarea, input, and button.
*There’s more though!
Give three examples of type attribute values for HTML input elements.
Radio, submit, email, checkbox, etc.
Is an HTML input element a block element or an inline element?
Inline element. If you have two input elements, they will sit right next to each other.
What are the six primary elements for creating an HTML table?
“table”, “thead”, “th”, “tr”, “td”, and “tbody”
*Worth noting that “tfoot” isn’t core for an HTML table.
What purpose do the “thead” and “tbody” elements serve?
Help for structure, and search indexing for your website.
“thead” = holds the heading titles (“th” element) of the table
“tbody” = holds the table data (“td” element) of the table
Give two examples of data that would lend itself well to being displayed in a table.
Financial reports, TV schedules, sports results, calendars, etc.