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