HTML Flashcards
What is the difference between an ordered list and an unordered list in HTML?
- ordered lists are lists where each item in the list is numbered (eg: steps for a recipe that must be performed in order)
- unordered lists are lists that begin with a bullet point (rather than characters that indicate an order of things)
Is an HTML list a block element or an inline element?
a block element
Where do you put non-visible content about the HTML document?
head element (for instance, users cant see meta tags on a web page)
Where do you put visible content about the HTML document?
body element
Where do the head and body tags go in a valid HTML document?
in the body element
head and body elements are siblings of each other
What is the purpose of a !DOCTYPE declaration?
to tell a browser which version of HTML the page is using
Give five examples of HTML element tags
img, h1, body, main, div
What is the purpose of HTML attributes?
to tell us more about the element
Give an example of an HTML entity (escape character)
& c o p y ;
How do block-level elements affect the document flow?
- they take up the full width available
- start on a new line
- has top and bottom margin
How do inline elements affect the document flow?
- they take up as much width as necessary
- don’t start on a new line
What are the default width and height of a block-level element?
height: takes up as much height as necessary
width: 100%
What are the default width and height of an inline element?
height: takes up as much width as necessary
width: takes up as much width as necessary
What HTML tag is used to link to another website?
a tag / anchor tag
users can click on anything in between the opening <a> tag and the closing </a> tag (the text users click on is known as a link text)
you specify which page you want to link to using the href attribute
What is an absolute URL?
a link to a different website where the href attribute is the full web address for the site
an absolute URL includes an https protocol