HTML & CSS Flashcards
Where do you put non-visible content about the HTML document?
Within the < head > element.
Where do you put visible content about the HTML document?
Within the < body > element.
Where do the ‘head’ and ‘body’ tags go in a valid HTML document.
Both should be one level down from the < html > tag.
What is the purpose of a ‘!DOCTYPE’ declaration?
To let the browser know which version of HTML to open the page with.
What is the purpose of HTML attributes?
HTML attributes provide additional information about HTML elements.
How do block-level elements affect the document flow?
Each block-level element starts on a new line, and takes up the entire width of whatever line it occupies.
How do inline elements affect the document flow?
Each inline element only takes up as much height and width as its element; and can be nested within other blocks.
What are the default width and height of a block-level element?
width: entire line
height: size of element
What are the default width and height of an inline element?
width: size of element
height: size of element
What is the difference between an ordered list and an unordered list in HTML?
An ordered list is organized by number, while an unordered list is displayed with unordered bullet points by default.
Is an HTML list a block element or an inline element?
block-level element
What HTML tag is used to link to another website?
the < a > tag
What is an absolute URL?
A URL directly to an image on the world wide web.
What is a relative URL?
A relative URL is shorter, but it can only be used to refer to links that reside on the same server as the page that refers them.
How do you indicate the relative link to a parent directory?
Use ../ to indicate the folder above the current one, then follow it with the file name.
How do you indicate the relative link to a child directory?
Use the name of the child folder, followed by a forward slash.
How do you indicate the relative link to a grand parent directory?
Repeat the ../ to indicate that you want to go up two folders (rather than one).
How do you indicate the relative link to the same directory?
Just use the file name. (Nothing else is needed.)
What is the purpose of an HTML form element?
HTML forms give you a set of elements to collect data from your users.
Give five examples of form control elements.
< input >, < label >, < select >, < textarea >, < button >, < fieldset >, < legend >, < datalist >, < output >, < option >, < optgroup >
Give three examples of type attributes for HTML < input > elements.
“text”, “radio”, “checkbox”, “password” , “file”, “submit”, “image”, “hidden”
Is an HTML < input > element a block element or an inline element?
inline element