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
What is a relative URL?
a link to other pages within the same site and you can locate it by calling its folder and or file
How do you indicate the relative link to a parent directory?
../ to indicate the folder above the current one and follow it with the file name
from relative link to home page (parent directory): ../index.html
How do you indicate the relative link to a child directory?
use the name of the child folder followed by a forward slash and then the file name
from relative link (eg. home page) to music listings (child directory): music/listings.html
How do you indicate the relative link to a grandparent directory?
use ../ twice to indicate that you want to go up two folders then follow it with the file name
from relative link (eg. DVD reviews) to home page (grandparent folder): ../../index.html
How do you indicate the relative link to the same directory?
use the file name
to link from relative link or music homepage to music reviews: reviews.html
What is the purpose of an HTML form element?
to collect information from users
Give five examples of form control elements.
text input, password input, text area, radio button, checkbox, drop-down list box, multiple select box, submit button, etc..
Give three examples of type attributes for HTML elements.
text, password, submit
Is an HTML element a block element or an inline element?
inline
What are the six primary HTML elements for creating tables?
table row table data table heading tbody thead
What purpose do the thead and tbody elements serve?
to distinguish between the main content of the table and the headings of the table
Give two examples of data that would lend itself well to being displayed in a table.
movie schedules and financial reports