Quiz Questions Flashcards
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?
In the < html > element.
What is the purpose of a < !DOCTYPE > declaration?
to define the type of document/file that it is.
Give five examples of HTML element types.
< head > , < title >, < body >, < p >, < h1 >
What is the purpose of HTML attributes?
to provide additional information about HTML elements.
Give an example of an HTML entity (escape character).
© for ©
How do block-level elements affect the document flow?
Block elements will always appear starting on a new line.
How do inline elements affect the document flow?
Inline elements will always appear to continue on the same line as the neighbouring elements.
What are the default width and height of a block-level element?
the default height and width of a block element is the height of the content and width of the page.
What are the default width and height of an inline element?
Inline elements are both the height and width of the content.
What is the difference between an ordered list and an unordered list in HTML?
Ordered list is portrayed with numbers (i.e. in order) and an unordered list is portrayed as a list with bullet points indicating no specific numeric order.
Is an HTML list a block element or an inline element?
yes lists < li > are a block level element tag.
What HTML tag is used to link to another website?
the < a href=” “ > tag is used for linking to another website.
What is an absolute URL?
an absolute URL is one that takes you to a different website outside of your current one.
What is a relative URL?
A relative URL is one where it links only within the same current website (i.e. navigation for a site).
How do you indicate the relative link to a parent directory?
Use ../ to indicate the folder is a parent folder (above the current one), then follow it with the file name.
Ex. < a href=”../index.html” >Home< /a >
How do you indicate the relative link to a child directory?
Use the name of the folder followed by a forward slash, then file name.
Ex. < a href=”music/listings.html” >Listings< /a >
How do you indicate the relative link to a grandparent directory?
Use ../ but twice, to indicate that you want to go up two folders from the current one, followed by the file name.
Ex. < a href=”../../listings.html” >Listings< /a >
How do you indicate the relative link to the same directory?
Use the file name if it is within the same folder/directory.
Ex. < a href=”listings.html” >Listings< /a >
What is the purpose of an HTML form element?
An HTML form is used to collect user data/input.
Give five examples of form control elements.
Ex. - input, label, select, button, textarea
Give three examples of type attribute values for HTML < input > elements.
Ex. - radio, checkbox, submit
Is an HTML < input > element a block element or an inline element?
It is an inline-block element.
It’s hybrid, whereas normal inline can’t allow you to adjust height and width, thought you can with inline-block
What are the six primary HTML elements for creating tables?
tr, th, td, thead, tbody, tfooter, table
What purpose do the thead and tbody elements serve?
To help distinguish between the heading (shows up as header as well) and body elements of the table in a similar manner to normal HTML structure.
Give two examples of data that would lend itself well to being displayed in a table.
Ex. - financial reports, tv schedules, statistics
What are the names of the individual pieces of a CSS rule?
selector, declaration block, declarations (each line within the block), property, value, open/close curly brace.
In CSS, how do you select elements by their class attribute?
you select the class attribute in CSS by using a period ( . )
Ex. .note or .intro
In CSS, how do you select elements by their type?
you just use their element name.
Ex. h1 will select the h1 element.
In CSS, how do you select an element by its id attribute?
To select an element by an id, you use the hashtag symbol ( # )
Usually bad practice to style using id selectors for CSS - Tim Horist.
Ex. #introduction
Name three different types of values you can use to specify colors in CSS.
RGB Value, Hex Code, and Color Name.
What CSS properties make up the box model?
Padding, Border, Margin
Which CSS property pushes boxes away from each other?
Margins
Which CSS property add space between a box’s content and its border?
Padding.
What is a pseudo-class?
A pseudo-class is used to define a special state of an element.
For example, it can be used to:
Style an element when a user mouses over it
Style visited and unvisited links differently
Style an element when it gets focus
What are CSS pseudo-classes useful for?
To indicate, hovering of an element via cursor, activation of an element, and when an element has focus.
as a dev, can take advantage of these as you don’t have to modify the html document to add a new specific class.
Name two types of units that can be used to adjust font-size in CSS.
Pixels, and Percentages (can also use EMS)
What CSS property controls the font used for the text inside an element?
font-family is the property used to determine the font used for text inside that element.
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?
div is block level element
What is the default flex-direction of an element with display: flex?
row ( left to right )
What is the default value for the position property of HTML elements?
static positioning
How does setting position: relative on an element affect document flow?
it does not
How does setting position: relative on an element affect where it appears on the page?
by adding properties of top/bottom/left/right to move said element from its initial position relative in the normal flow.
How does setting position: absolute on an element affect document flow?
it is taken out of the normal flow and put into its own sort of plane. so the other elements close in as if it didnt exist.
How does setting position: absolute on an element affect where it appears on the page?
it depends, if the absolute was contained in a
How do you constrain an absolutely positioned element to a containing block?
any non static. - fixed/relative/etc.
What are the four box offset properties?
top/bottom/left/right
What are the four components of “the Cascade”.
Cascade, Inheritance, Specificity, & !important,
What does the term “source order” mean with respect to CSS?
The order of read/execution of CSS, from left-to-right then top-to-bottom. ( as long as specificity is the same )
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
via Inheritance, if there is no specific property for said child element, if it is an inheritable trait.
List the three selector types in order of increasing specificity.
Tag, Class, ID
Why is using !important considered bad practice?
it interacts directly with specificity and the cascade. [ It reverses the cascade order of stylesheets, so could throw things off. ]