Part 4 - CSS Flashcards
What does CSS stand for?
Cascading Style Sheets
What is the function of CSS?
CSS is a W3C standard for describing the appearance of HTML elements
Give the general syntax of an inline style in HTML. Use two declarations.
style=”font-size: 24pt; font-weight:bold;”
How would you indicate a class selector in CSS, and what is the benefit of using such a selector?
.example_class This selector will target all HTML elements with the indicated class, irrespective of where these elements are located in the document
Name the benefits of using CSS
- Improved control over formatting.
- Improved site maintainability.
- Improved accessibility.
- Improved page-download speed.
- Improved output flexibility (responsive design)
What is contained in a CSS rule?
- A selector that indicates which HTML element should be altered
- Followed by a series of property:value (declaration) pairs
Structure:
selector { property: value; property2: value2; }
How would you indicate the use of an external stylesheet in HTML?
How is an id selector indicated in CSS?
example_id
Show the 6 types of CSS attribute selectors, and indicate the function of each one
[] - A specific attribute.
[=] - A specific attribute with a specific value.
[~=] - A specific attribute whose value matches
at least one of the words in a space delimited
list of words.
[^=] - A specific attribute whose value begins with a specified value.
[*=] - A specific attribute whose value contains a substring.
[$=] - A specific attribute whose value ends with a specified value.
What is a pseudo-element selector?
A way to select something that does not exist explicitly as an element in the HTML document tree but which is still a recognizable selectable object
What is a pseudo-class selector?
A selector that does apply to an HTML element, but targets a particular state
What is the difference between relative and absolute measure units in CSS? Which one is preferred and why?
- The absolute units always indicate a fixed length, while with the relative units the length is always calculated in relation to other elements.
- Relative units preferred in order to help the website to adjust correctly across different devices and window sizes.
What is a web font stack and why necessary?
List of fonts in the CSS font family declaration.
Necessary to control the look of the website even if the initial font indicated is not installed on the client computer
List the cascade principles in CSS responsible for dealing with conflicts, in order of override
- Location
- Specificity
- Inheritance
What is responsive design?
- The page responds to changes in the (height, width, etc)
- Makes webpage accessible from different devices