HTML Flashcards
Where do you put non-visible content about the HTML document?
Non-visible content goes in the head. meta,title etc etc
Where do you put visible content about the HTML document?
Body element contains all the visible content the viewport will see
Where do the head and body tags go in a valid HTML document?
They go inside of the html tags and are it’s children (with head and body themselves being sibilings.
What is the purpose of a declaration?
The doctype declaration is literally telling the browser which html it’s using.
Give five examples of HTML element types.
head, html, div, body, span, p etc etc A TON of html elements exist. Most noteworthy thing is that DOCTYPE is a declaration and specifically not an element
What is the purpose of HTML attributes?
Attributes can both modify an element further and provide additional information and context for an element. Most notably they will always contain a NAME and VALUE
Give an example of an HTML entity (escape character).
An example of an entity could be < being < All entities begin with & and end with ; If known they can be much more efficient then looking up a symbol could be. As well as writing a symbol that html already has a special purpose for.
How do block-level elements affect the document flow?
Block-level elements always start on a newline and create space on the next line after it is finished.
How do inline elements affect the document flow?
They affect the document much less, as they do not force line breaks.
What are the default width and height of a block-level element?
The default width is 100% because it always takes up the maximum horizontally space wise. Vertically they are auto, and take as much space as necessary.
What are the default width and height of an inline element?
Inline elements width and height wise are auto. They by design take up the minimum space necessary.
What is the difference between an ordered list and an unordered list in HTML?
Ordered lists number things like 1, 2, 3 etc as unordered lists will do something like bullet points.
Is an HTML list a block element or an inline element?
ul and ol and even li are all elements that are block elements.
What are the six primary HTML elements for creating tables?
table, thead, tbody, td, tr, th
What purpose do the thead and tbody elements serve?
thead is the heading, the tbody contains the data
Give two examples of data that would lend itself well to being displayed in a table.
stocks, calculating a budget
What HTML tag is used to link to another website?
The anchor element <a> tag is used to link to another website</a>
What is an absolute URL?
An absolute URL is when you use the whole URL as a link. This is often only used when going to somewhere outside of your own webpage.
What is a relative URL?
When using relative url, if all of the files are in the same folder. Then the value is just the filename.
How do you indicate the relative link to a parent directory?
Use the ../ to indicate going one directory above.
How do you indicate the relative link to a child directory?
use the filename/file.html or whatever the file type is.
How do you indicate the relative link to a grand parent directory
You use the ../../ to go to the grand parent directory. Note you basically just repeat ../ to go two directories up instead of one. Can repeat as many times as necessary
How do you indicate the relative link to the same directory?
You just write out the filename. It should just be right there.
What is the purpose of the HTML form element
Creates a boundary that around all the types of control elements. It generally wants to just be surrounding all your inputs. Proper syntax means it’ll always contain all the interactive elements of your document.
Give five examples of form control elements.
Select, input, textarea, label, form, button.
Give three examples of type attribute values for HTML elements.
radio, search, submit
Is an HTML input element a block element or an inline element?
input is an inline element