HTML/CSS Quiz Flashcards
Where do you put non-visible content about the HTML document?
between opening and closing tag
Where do you put visible content about the HTML document?
between opening and closing tag
Where do the and tags go in a valid HTML document?
between opening and closing tag
What is the purpose of a declaration?
letting browser know that we’re using most recent version of the HTML
Give five examples of HTML element tags.
img, heading(h1, h2, ..), anchor, form, table
What is the purpose of HTML attributes?
Attributes provide additional information
about the contents of an element. They are made of two parts: attribute name and attribute value.
Give an example of an HTML entity (escape character).
© “copyright”
What is the difference between an ordered list and an unordered list in HTML?
ordered list is in order using numbers or alphabets, unordered list uses symbols like bullet points.
What three HTML elements do you use to build a description list?
<dl> description list
<dt> description title
</dt><dd> description definition</dd></dl>
Name three different types of values you can use to specify colors in CSS.
RGB, RGBA, HEX, Named Colors
What is source order? (in CSS)
The order that CSS rules are written in stylesheet.
What purpose does the CSS Cascade serve?
To determine what styling should ultimately be applied to an element.
In what situations might you need to apply styling to a single element multiple times in one stylesheet?
as an example, when working with media queries for mobile responsiveness we may apply more than one styling to specific elements based on the size of the device.
What is inheritance?
Inheritance is the process by which certain CSS properties on a child HTML element can receive value from a parent element, if no CSS for that property is directly declared on the child element.
Why might CSS include this feature?
it will results in simpler style sheets
Is inheritance a good tool to use for styling? If so, on what occasions?
It saves you from having to apply
these properties to as many
elements (and results in simpler
style sheets). for example when styling added to a parent and all child elements inheritance.
What is the purpose of !important?
Adding !important increases the specificity of a style applied to an element takes that immediate styling and doesn’t allow further style change, it also by pass any inline styling!
When is !important a good tool to use?
To override styles that are declared somewhere else or prevent any further styling on all elements of the kind interfering with one specific element!
What is specificity?
Is how browser decides which CSS property values are the most relevant to an element, therefore will be applied.
How is specificity calculated?
Based on which CSS selector is being used to target an element.
Why might CSS include this (specificity) feature?
To have ability to target and apply styling to an specific element easier.
What is the order of selector strengths for CSS specificity (commonly referred to as the Specificity Hierarchy)?
- Type selectors (directly targeted elements, e.g., h1) and pseudo-elements (e.g., ::before).
- Class selectors (e.g., .example), attributes selectors (e.g., [type=”radio”]) and pseudo-classes (e.g., :hover).
- ID selectors (e.g., #example).
- Universal selector and
then:
Cascade and inheritance
and in-line styling.