HTML Flashcards
Where do you put non-visible content about the HTML document?
head tag
Where do you put the visible content of the HTML document?
body tag
What is the purpose of a declaration?
to tell a browser which version of HTML is being used
Give five examples of HTML element types.
head, body, img, div, h1-6, p, a, span…
What is the purpose of HTML attributes?
they tell us more about the content of the html element to which they are assigned
Give an example of an HTML entity (escape character).
&_amp; = &
&_copy; = copyright symbol
&_reg; = registered trademark
&_trade; = TM trademark
[without the _ ]
How do block-level elements affect the document flow?
– structure of the page
– they always start a new line in the window
– a new chunk of info to display
– headers, paragraphs, lists, etc
Examples of block elements are h1, p, ul, li
How do inline elements affect the document flow?
– semantic info, emphasis
– continue on the same line as neighbouring elements
– modify/effect small parts of a larger whole
– italicize, bolden, quote, links, line breaks, etc
What are the default width and height of a block-level element?
– one line high and as wide as can be
A block-level element always starts on a new line and takes up the full width available (stretches out to the left and right as far as it can).
What are the default width and height of an inline element?
– one line high and only as wide as needed
Inline elements are those which only occupy the space bounded by the tags defining the element, instead of breaking the flow of the content.
What is the difference between an ordered list and an unordered list in HTML?
– ordered is sequentially numbered (ie: instruction steps) (ol, li)
– unordered is a general bullet-pointed list (ie: grocery list) (ul, li)
– definition lists is to define terminology (dl, dt, dd)
Is an HTML list a block element or an inline element?
block element
What HTML tag is used to link to another website?
– a, anchor tag
a href=”url”>link description text a
What is an absolute URL?
the full web address for an external site/link
What is a relative URL?
links to local pages/content within the same site
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.
a href=”../index.html”>Home
How do you indicate the relative link to a child directory?
For a child folder, use the name of the child folder, followed by a forward slash, then the file name.
a href=”folder/listings”>Listings /a
How do you indicate the relative link to a grand parent directory?
Use the name of the child folder, followed by a
forward slash, then the name of the grandchild
folder, followed by another forward slash, then the
file name.
a href=”movies/dvd/reviews.html”>Reviews a
How do you indicate the relative link to the same directory?
To link to a file in the same folder, just use the file name.
a href=”reviews.html”>Reviews
How do you open links into new tabs?
Use the target attribute with the value “_blank”.
What is the purpose of an HTML form element?
– to collect information from the user
The element represents a document section containing interactive controls for submitting information.
Give five examples of control elements.
input, label, select, textarea, fieldset, legend, button, dataset, output, option, optgroup
Give three examples of type attribute values for HTML elements.
– type=”text : for text field
– type=”password” : for hidden pw input
– type=”checkbox” : for selecting one or more options
– button, color, date, email, file, image, range, etc…
Is an HTML input element a block element or an inline element?
inline
What are the six primary HTML elements for creating tables?
table, tr, td, th
thead, tbody, tfoot
What purpose do the thead and tbody elements serve?
– thead stores the table headings
The thead element defines a set of rows defining the head of the columns of the table.
– tbody stores the body of the table
The tbody element encapsulates the table rows elements, indicating that they comprise the body of the table.
– tfoot is used for lengthy tables that extend several page, encloses the table so the thead content will show as you scroll.
Give two examples of data that would lend itself well to being displayed in a table.
grades, scores, financial reports, schedules