CSS Flashcards

1
Q

Collapses in the box model

A

margin (only largest padding between 2 elements is shown)

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

box model to contain the width with all the elements

A

*{ box-sizing: border-box}
Its original set to content-box

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

Box model elements

A

padding, border, margin

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

add a border to an element

A

border: 4px solid #000

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

define all paddings on a single line

A

padding: 4px 5px 6px 8px
(trouble, top right bottom left)

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

add different widths to a border

A

border-width: 10px 30px 40px 50px

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

shrink/grow the width depending on the size of the parent

A

width: 50%

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

shrink/grow based on the size of the screen

A

width: 50vw
height: 50vh
(view width, and view height)

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

size based on root font size

A

font-size: 1rem

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

general root font size

A

16px

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

size font based on the parent

A

em, and %

font-size: 1em

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

font css

A

font-family
font-size
font-style

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

why is using rem better than using pixels

A

they scale if the user changes the font size of their screen

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

set css for a button

A

background: red;
border: 1px solid black;
outline: none
cursor:pointer

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

em are used when scaling buttons to the size of the text in:

A

border-radius: .3em
padding: .5em .3em

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

how to use float

A

float: left/right
clear: left/right/both

17
Q

document flow display types

A

display: block
display: inline
display: inline-block (can add width & height)
display: none (removes it)

18
Q

removes the right margin from the last button inside of a footer

A

.footer .btn:last-child{
margin-right:initial;
}

19
Q

default css position

A

static

20
Q

css position where you can add top, right, left, bottom

A

position:relative (lo desplaza relativo a su lugar)

21
Q

css position:absolute

A

lo deja donde va pero como si no existiera (pone otras cosas abajo de el), lo pone absolutamente en las posiciones del contenedor en el que está. siempre y cuando el parent tenga position: relative o alguno. si no tiene es de toda la página

22
Q

lo deja fijo siempre en un punto cuando haces scroll

A

position:fixed

23
Q

select an input that it’s not checked

A

input:not(:checked)

24
Q

use variables

A

:root{
–primary-color: green
}

.tree{
color:var(–primary-color)
}

25
Q

select paragraphs that don’t have the class of red or green

A

p:not(.red):not(.green)

26
Q

change the color to red of an input of type text

A

input[type=”text”]{background-color: red}

27
Q

pseudo elements

A

p::first-line, p::first-letter