CSS Flashcards

1
Q

CSS stands for…

A

Cascading Style Sheets

It is a language for describing the presentation of web pages.

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

inline CSS definition

A

< style=”background-color: tomato” > My text < /p >

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

internal CSS definition

A

< style > p { background-color: tomato < /style >

All paragraphs are now tomatoes!

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

External CSS definition

A

One or more CSS files included in the html:

in the head tags:

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

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

CSS rule set syntax

A
selector {
    property: value;
    ...
    ...
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

CSS selectors

A
by element(tag)
    p {...}
by class
    .thisClass{...}
by id
    #thisID{...}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

CSS length units

A

Pixel (px): absolute size, different on different monitors, bad for accessibility

EM, %, and rem are relative sizes: 1em = as large ad your base font size.

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

CSS cascade…order of importance

A
Low to high:
User agent
User
Author
Author !important
User !important
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

CSS cascade…specificity

A

The more specific declaration “wins”

low to high:
element(tag) selectors
class selector
id selectors
inline style
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

CSS combinators

A
el1, el2 {...}
    selector list
el1 > el2 {...}
    el2 is a direct child of el1
el1 el2 {...}
    el2 is a descendant of el1
el1 + el2{...}
    el1 is the direct sibling of el2
el1 ~ el2{...}
    el1 and el2 are general siblings
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

CSS attribute selectors

A

selector[html_attribute=”value”]{…}

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

CSS Pseudo classes

A

selector:pseudo-class

fx:
a:visited{…};

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

CSS Pseudo Elements

A

selector::pseudo-element

fx:
::first-line{…}

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

CSS the box model

A

When html is rendered, a box is drawn around each element. Additionally there are optional areas:
padding, border, margin

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

Padding vs Margin

A

Padding adds space within the element

Margin adds space around an element

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

Block element vs inline element

A

Block element starts a new line and takes as much width as possible

Inline elements start from the current pos and take as mutch space as needed

17
Q

Display style

A

Display:
block;
inline;
none;

18
Q

Float

A

float: left;

Allows inline elements to “float” around this element

19
Q

Position

A

position: relative; top: 20px; left: 20px;

As in the normal flow but with relative offset

20
Q

Flexbox

A

Makes positioning easier.

Gives containers a number of properties

21
Q

Responsive web design… boil it down

A

RWD make websites adapt to the devices they’re being viewed on instead of sending visitors to different sites.

22
Q

Responsive Web Design… What does it tackle?

A

Different screen sizes
Different resources(computing power etc)
Different input methods

23
Q

Responsive Web Design… how?

A

Relative length units
Flexbox
CSS media Queries

24
Q

CSS media Queries

A

Allow you to define CSS depending on medium:

Screen size
Device
Resolution
Input
Orientation
etc...
example
@media screen and (max-width: 400px) {
    #myUnimportantDiv { display: none}
}

This makes element with id myUnimportantDiv invisible when the screen is less than or equal to 400px