Part 4 - CSS Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What does CSS stand for?

A

Cascading Style Sheets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the function of CSS?

A

CSS is a W3C standard for describing the appearance of HTML elements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Give the general syntax of an inline style in HTML. Use two declarations.

A

style=”font-size: 24pt; font-weight:bold;”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How would you indicate a class selector in CSS, and what is the benefit of using such a selector?

A
.example_class
This selector will target all HTML elements with the indicated class, irrespective of where these elements are located in the document
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Name the benefits of using CSS

A
  • Improved control over formatting.
  • Improved site maintainability.
  • Improved accessibility.
  • Improved page-download speed.
  • Improved output flexibility (responsive design)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is contained in a CSS rule?

A
  • 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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How would you indicate the use of an external stylesheet in HTML?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How is an id selector indicated in CSS?

A

example_id

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Show the 6 types of CSS attribute selectors, and indicate the function of each one

A

[] - 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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a pseudo-element selector?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a pseudo-class selector?

A

A selector that does apply to an HTML element, but targets a particular state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the difference between relative and absolute measure units in CSS? Which one is preferred and why?

A
  • 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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a web font stack and why necessary?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

List the cascade principles in CSS responsible for dealing with conflicts, in order of override

A
  • Location
  • Specificity
  • Inheritance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is responsive design?

A
  • The page responds to changes in the (height, width, etc)

- Makes webpage accessible from different devices

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How is responsive design achieved?

A
  1. Liquid layouts (using relative units in CSS)
  2. Scaling images to viewport size
  3. Setting viewports via the tag
  4. Customising the CSS for different viewports using media queries
17
Q

Arrange the following CSS selectors in descending order of specificity:

  • div #example
  • # example
  • div
  • .example
A
  • div #example
  • # example
  • .example
  • div