HTML Flashcards
HTML Quiz Questions from LFZ Full Time Immersive
Where do you put non-visible content about the HTML document?
Inside the head element
Where do you put visible content about the HTML document?
Inside the body element
Where do the meta, link, and title tags go in a valid HTML document?
They go after the DOCTYPE and inside the head tag
What is the purpose of the DOCTYPE declaration?
It tells the browser which version of HTML we are using so it can accurately render the page
Give 5 examples of element types.
head, body, h1 - h6, div, nav
What is the purpose of HTML attributes?
Attributes provide additional information about elements (CAN add functionality like src for img)
Give an example of an HTML entity (escape character).
Ampersand ( & amp )
What are the two functions of an alt attribute?
- shows text content if image doesn’t load
- Reads outloud for people using screenreaders for accessibility
How do block-level elements affect the document flow?
Each new block-level element starts a new line
How do inline-level elements affect the document flow?
They line up “inline”, appearing on the same line (assuming space is available)
What are the default width and height of a block-level element?
Width: width of page; Height: height of content
What are the default width and height of an inline element?
Width: width of content; Height: height of content
Why are strong and em tags preferred over b and i tags for bold and italic text?
Strong and em tags add semantic meaning, and screen readers will interpret them appropriately.
What is the difference between an ordered list and an unordered list in HTML?
Ordered lists emphasize order of items, while unordered lists just have bullet points
Is an HTML list a block element or an inline element?
Lists (ul, ol, & li) are all block elements
True or False? The only direct child a ul or ol element should have is an li element?
True
What HTML tag is used to link to another website?
the a (anchor) tag
What is an absolute URL?
Absolute URLs link to separate websites
What is a relative URL?
Relative URLs link to a different page of the same website
How do you open up a website in a new tab when using absolute URL paths?
Add the target attribute with the value “_blank”
How do you indicate the relative link to a parent directory?
../ (indicates the folder above the current one) then follow with the file name
How do you indicate the relative link to a child directory?
/ Child folder name / file name
How to you indicate the relative link to a grandparent directory?
../ ../ file folder name
How do you indicate the relative link to the same directory?
Just use the file name (nothing else needed)
What is the purpose of an HTML form element?
Forms allow users to perform functions online and collect data resulting from those functions
Give five examples of form control elements
Text/password input, radio buttons, drop down boxes, file input boxes, submit/img button
Give three examples of type attribute values for HTML input elements
Type, name, value
Is the HTML input element a block element or an inline element
Inline-block!
All buttons in a form have a default type attribute of…?
Submit
6 primary elements for tables
Table, thead, tbody, tr, th, td
What purpose do the thead and tbody serve?
Thead defines a set of rows heading each column of the tables; tbody is the rows w/data
Give two examples of data that would lend itself well to being displayed in a table.
Sports Statistics & Weekly weather forecasts