3.1 css Flashcards

1
Q

What is CSS?

A

CSS is a language that describes the style of an HTML document

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

What does CSS describe?

A

CSS describes how HTML elements should be displayed

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

What is the purpose of using CSS?

A

Use CSS to define the page layout

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

What is Responsive Web Design (RWD)?

A

Creating websites which automatically adjust to look good on all devices

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

What is the ‘mobile first’ approach in web design?

A

First design the style for mobile devices

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

Name some browsers to consider for browser compatibility.

A

Chrome, Firefox, IE, Edge, Safari, Opera

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

Is using CSS or JavaScript preferred for animations?

A

CSS is preferred

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

Where can you find CSS references and tutorials?

A

https://www.w3schools.com/css/default.asp

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

When was the CSS1 specification developed?

A

In 1996

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

When was CSS2 released?

A

In 1998

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

What is the purpose of CSS usage?

A

Consistent presentation style

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

What are the levels of style sheets?

A

Inline, Internal, and External

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

What is an inline style sheet?

A

Specified for a specific occurrence of a tag and apply only to that tag

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

What is an internal style sheet?

A

Document level, apply to the whole document, in the head section

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

What is an external style sheet?

A

Can be applied to any number of documents, in the head section

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

What is the cascading order browsers use for CSS?

A

Inline > id > class/pseudo class/attribute > element/pseudo-elements > combinators> * > default style

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

What is the correct HTML to link to an external style sheet?

A

< link rel=”stylesheet” type=”text/css” href=”mystyle.css”>

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

Name the five categories of CSS Selectors.

A

Simple selectors, Combinator selectors, Pseudo-class selectors, Pseudo-elements selectors, Attribute selectors

19
Q

What do simple selectors do?

A

Select elements based on name, id, class

20
Q

What do combinator selectors do?

A

Select elements based on a specific relationship between them

21
Q

What do pseudo-class selectors do?
lvah

A

Select elements based on a certain state

22
Q

What do pseudo-elements selectors do?
(bas fl fs)

A

Select and style a part of an element

23
Q

What do attribute selectors do?
and struture

A

Select elements based on an attribute or attribute value

24
Q

How do you declare declarations in CSS?

A

tag names {property_1: value_1; property_2:value_2; …}

25
How are element selectors grouped? simultaneously
**h1, h2, h3 {color: green;}**
26
How are ID selectors defined in CSS?
**#section14 {font-size: 20}**
27
How are class selectors defined in CSS?
**p.normal {property-value list}**
28
How are generic selectors defined in CSS?
**tag {property-value list}**
29
How are universal selectors defined in CSS?
**\* {property-value list}**
30
How are descendant selectors applied in CSS?
**h1 em {color:blue}**
31
How are child selectors defined in CSS?
**div > p { background-color: yellow;}**
32
How are adjacent sibling selectors defined in CSS?
**div + p { background-color: yellow; }**
33
How are general sibling selectors defined in CSS?
**div ~ p { background-color: yellow; }**
34
Give an example of a pseudo class selector for hover.
**input:hover {color: red; background: pink;}**
35
Give an example of a pseudo class selector for a visited hyperlink.
**a:visited {color:#00FF00;}**
36
Give an example of a pseudo element selector using '::before'.
**p::before {content: "Note: ";}**
37
Give an example of a pseudo element selector using '::first-letter'.
**p::first-letter {font-size: 200%;}**
38
Give an example of a pseudo element selector using '::selection'.
**::selection {color: white; background: black;}**
39
Give an example of an attribute selector.
**input[required]{ border: 2px solid red; }**
40
Give an example of an attribute selector with a specific value.
**input[type=“text”]{ width: 200px; }**
41
What is the order of CSS Specificity from highest to lowest?
**Inline > id > class/pseudo class/attribute > element/pseudo-elements > combinators> * > default style**
42
If two rules have the same specificity, which one takes precedence?
The one that **appears later in the stylesheet**
43
What is the order of precedence for the origin of styles?
**User Agent Stylesheet > User Styles > Author Styles > Inline Styles > !important Rules**