HTML Flashcards
(99 cards)
Where do you put non-visible content about the HTML document?
In the “head” element.
Where do you put visible content about the HTML document?
In the “body” element.
Where do the <head> and <body> tags go in a valid HTML document?
Within the “html” element as siblings.
What is the purpose of a <!DOCTYPE> declaration?
Instruction to the web browser about what version of HTML the page is written in. Ensures the web page is parsed the same way by different web browsers.
What is the purpose of the HTML attributes?
To provide additional information about HTML elements.
name=”value”
ex. HTML element types
ex. HTML entity(escape character)
” <head>, <title>, <body>, <h1>, <p>, <html> "</title>
< (<), ® (Ⓡ), & (&), " (“), &apos (‘) **
**followed by semicolon
How do block-level elements affect the document flow?
default value for height and width
They stack, block-level elements start on a new line.
Block-level element occupies the entire horizontal space of its parent element(container), and vertical space equal to the height of its contents.
height - auto
How do inline elements affect the document flow?
default value for height and width
Only occupy the space bounded by the tags defining the element.
Do NOT force a new line to begin in the document flow.
height and width - auto
Is an HTML list a block or an inline element?
Difference between an ordered list and unordered list.
HTML lists are block elements.
Ordered lists are used to create a list of related items, in a specific order. (Ascending numerical order)
Unordered lists are used to create a list of related items, in no particular order. (Bullet points)
What HTML tag is used to link to another website?
Absolute URL vs Relative URL
The anchor tag (<a>) is used to link to another website.</a>
Absolute - contains the whole URL address, including protocol (http/https), the optional subdomain (www.), domain (google.com), and path (directory and slug)
Relative - contains a URL that only includes the path (directory and slug). Path is everything after the domain.
How do you indicate the relative link to the same directory?
a parent directory?
a child directory?
a grand parent directory?
File name or .
../ + file name
Name of child folder + file name
../../ + file name
What is the purpose of an HTML form element?
Give five examples of form control elements.
Boundary of the form element and used to collect user input
input, label, select, textarea, button, fieldset
Is an HTML <input></input> element a block element or an inline element?
Give three examples of type attribute values for HTML <input></input> elements.
inline
type, name, value
What are the six primary HTML elements for creating tables?
tr, td, th, thead, tbody, table, tfoot
What purpose do the thead and tbody elements serve?
thead refers to the head of the table
tbody refers to the body of the table
Structural purpose
Give two examples of data that would lend itself well to being displayed in a table.
Financial reports, tv schedules, sports results
What are the names of the individual pieces of a CSS rule?
selector & declaration > declaration block > property & value
In CSS, how do you select elements by their class attribute?
. (dot)
In CSS, how do you select elements by their tag name?
element name
In CSS, how do you select an element by its id attribute?
(octothorpe) #
Name three different types of values you can use to specify colors in CSS.
color name, hex code, rgb value
What CSS properties make up the box model?
width, height, padding, border, margin
Which CSS property pushes boxes away from each other?
Which CSS property add space between a box’s content and its border?
margin
padding
What is a pseudo-class?
keyword added to a selector that specifies a special state of the selected element
selector that selects elements that are in a specific state,
(break)