HTML Flashcards
Where do you put non-visible content about the HTML document?
Inside the head element.
The content is known as metadata.
Where do you put visible content about the HTML element?
Inside the body element.
Where do the head and body tags go in a valid HTML document?
They are located inside of the html element.
What is the purpose of a !Doctype declaration?
This tells the browser what version of HTML to parse through
Give five examples of HTML element types.
- Head
- Body
- Div
- P
- html
What is the purpose of HTML attributes?
To give additional information about the HTML element.
Give an example of an HTML entity (escape character).
®
always starts with &(ampersand) and ends with ;
How do block-level elements affect the document flow?
They take up the full width available, will always start force a new line, will stack on top of each-other.
How do inline elements affect the document flow?
Inline elements display in same line, don’t force a new line after them, only take up as much width as they need.
What are the default width and height of a block-level element?
The default width is the entire width of the parent element or of the page.
The default height is auto.
What are the default width and height of an inline element?
The default width is auto.
The default height is auto.
What is the difference between an ordered list and an unordered list in HTML?
Ordered lists are numbered 1,2,3,4 etc
Unordered lists are bullet points
Is an HTML list a block element or an inline element?
HTML List element is a block element
What HTML tag is used to link to another website?
The anchor tag
What is an absolute URL?
An absolute url is one with an https start
What is a relative URL?
A relative URL is a file path
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, then file name.
How do you indicate the relative link to a grand parent directory?
Repeat the ../ to indicate that you want to go u two folders, then follow it with the file name
ex. ../../index.html
How do you indicate the relative link to the same directory?
To link a file in the same folder, just use the file name.(Nothing else is needed)
What is the purpose of an HTML form element?
A document section containing interactive controls for submitting information.
Give five examples of form control elements.
- Button
- Textarea
- Input
- Select
- Input Type
Give three examples of type attribute values for HTML input elements.
- Checkbox
- File
- Radio
Is an HTML input element a block element or an inline element?
It is inline
What are the six primary HTML elements for creating tables?
- Table
- tablehead
- tr
- th
- td
- tbody
* 7. tfoot
What purpose do the thead and tbody elements serve?
thead houses the headings of the table so titles on columns and rows
tbody houses the body of the table so the information to put in the data cells
Give two examples of data that would lend itself well to being displayed in a table.
Finances and lap times on a track
What are the names of the individual pieces of a CSS rule?
Selector, Declaration block, Property and it’s value
In CSS, how do you select elements by their class attribute?
with a period followed by the class name
In CSS, how do you select elements by their type?
Just use the name of the element needing to be selected
In CSS, how do you select an element by its id attribute?
Use a hashtag followed by the id name
Name three different types of values you can use to specify colors in CSS.
RGB Values
Hex Codes
Color Names
What CSS properties make up the box model?
Border
Margin
Padding
Content - Height and Width
Which CSS property pushes boxes away from each other?
Margin property
Which CSS property add space between a box’s content and its border?
The padding property
What is a pseudo-class?
Class applied to an element by the browser when in a specific state
What are CSS pseudo-classes useful for?
Name two types of units that can be used to adjust font-size in CSS.
Pixels
em
What CSS property controls the font used for the text inside an element?
font-family
What is the default flex-direction of a flex container?
Row
What is the default flex-wrap of a flex container?
No Wrap
Why do two div elements “vertically stack” on one another by default?
Because div elements are display type block
What is the default flex-direction of an element with display: flex?
Row
How does setting position: absolute on an element affect where it appears on the page?
an element set with position absolute will appear on top left corner of the nearest ancestor element that is set to a position property that is NOT STATIC