HTML Flashcards
Where do you put non-visible content about the HTML document?
Inside the opening tag and closing tag of the head element.
Where do you put visible content about the HTML document?
Inside the opening tag and closing tag of the body element.
Where do the head and body tags go in a valid HTML document?
Inside the opening and closing tags of the html element.
What is the purpose of a document type declaration?
To inform the browser of which version of the HTML is being used.
Give five examples of HTML element types.
h1-h6 p img ul/ol div em strong
What is the purpose of HTML attributes?
Configure an element to make it more unique with additional behavior.
Give an example of an HTML entity.
ampersand: &
trademark symbol
copyright symbol
What do all HTML entities require?
All HTML entities start with an & (ampersand) and end with a ; (semi-colon).
How do block-level elements affect the document flow?
Block-level elements:
- start on a new line
- take up 100% width available
- push elements that come after it to the next new line
How do inline elements effect the document flow?
Inline elements:
- takes up just the amount of space they need
- stays “inline”
What are the default width and height of a block-level element?
width: 100%
height: auto
What are the default width and height of an inline element?
width: auto
height: auto
What would happen if we place a span element inside a p element?
The span element will still show up on the same line since the span element is an inline element. IF the p element is inside the span element, the p element will show up on the next line!
What is the difference between an ordered list and an unordered list in HTML?
Ordered list (ol) is notated with numerical symbols that shows order. Unordered list (ul) is notated with bullet points. Both are customizable with CSS.
Is an HTML list a block element or an inline element?
block-level element
What HTML tag is used to link to another website?
an “a” element tags
What is an absolute URL?
A URL that leads to an external file/folder. Usually starts with https://
What is a relative URL?
A URL that leads to an internal file/folder.
How do you indicate the relative link to a parent directory?
../
How do you indicate the relative path to a child directory?
child directory name/file name
How do you indicate the relative link to a grand parent directory?
../../
How do you indicate the relative link to the same directory?
the specific file name only since it is inside the same “folder” aka directory
What is the purpose of an HTML form element?
It represents a document section containing interactive controls for submitting information.
Give 5 examples of form control elements.
input, select, button, textarea, option, etc.
form control elements are those that lets users provide data
Give 3 examples of type attribute values for HTML input elements
radio, text, submit, checkbox, password, numbers, button, etc.
What is the purpose of a label element in a form?
- It offers accessibility to visually impaired users.
- It auto focuses on the input that the label is attached to.
* ONLY for text that is necessary to understand the purpose of an input
ex) a radio button that tells the users which option they are choosing
Is an HTML input element a block element or an inline element?
inline element
What are the six primary HTML elements for creating tables?
table thead = semantic tbody = semantic th = bolds the text tr td *tfoot
What purpose do the thead and tbody elements serve?
Both thead and tbody element provides useful semantic information.
thead suggests it encapsulates a set of table headings
tbody suggests it encapsulates a set of data
Give 2 examples of data that would lend itself well to being displayed in a table
- comparison of products/prices/etc.
- tracking/record keeping of weather/profit/etc.
Link vs. Anchor elements?
Link element brings things in (importing)
Anchor element takes you elsewhere (makes users leave the page/current location within the page)
break vs. div
break element is to use on breaking a text that we want to be shown on the next line
div is more appropriate on most of the occassion
input type= button VS button
for semantic purposes, if it requires a button, use a button