CSS Box Model Flashcards

1
Q

Padding

A

-Separates the content from the border

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

Margin

A

-Area outside the border and is used to control the space between other elements.
-Vertical margin and horizontal margin
Code:
auto (centers the page)
margin: 2px //top and bottom 0 //left and right

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

Div element

A

Code:

<div></div>

Add divisions to a page

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

Link

A
  • Self closing element

- You can link the CSS file here

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

Border shorthand

A

.class {

border: line-width line-style color

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

Overflow

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

Filter

A

-Applying filters
Code used:
filter: blur(2px);

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

Box-shadow

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

Border-radius

A

Defines the border radii with pixels. Rounds the edges

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

Transform

A

Can rotate an object in degrees

Code:
transform: rotate(0.6deg) (can also use negative to rotate the opposite direction

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

Meta

A

-Goes in the head element

Code:
name=”viewport”
content=”width=device-width, initial-scale=1”

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

Box-sizing

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

Display using flex

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

Flexbox

A

Flexbox is a one-dimensional CSS layout approach that focuses on the flow of content. It offers the ability to control the way items are spaced and aligned within a container.

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

Flex direction

A

Specifies how flex items are placed in the flex container, by setting the direction of the flex container’s main axis.

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

Flex-wrap

A

Controls whether the flex container is single-line or multi-line, and the direction of the cross-axis, which determines the direction new lines are stacked in.

17
Q

Justify-content

A

Aligns flex items along the main axis of the current line of the flex container.

18
Q

Align-items

A

Aligns flex items along the cross axis of the current line of the flex container.

19
Q

Object-fit

A

Specifies how the contents of a replaced element should be scaled relative to the box established by its used height and width.

20
Q

Font-weight

A

Makes text bolder

21
Q

Letter-spacing

A

Spacing between letters (pixels)

22
Q

Float

A

The float property is used to place an element on the left or right of its container, allowing other content (such as text) to wrap around it.

23
Q

Rem

A

The rem unit stands for root em, and is relative to the font size of the html element.

Create an .sm-text selector and set the font-size to 0.85rem, which would calculate to be roughly 13.6px (remember that you set your html to have a font-size of 16px).

24
Q

:not Pseudo selector

A

The :not pseudo-selector can be used to select all elements that do not match the given CSS rule.

Code:
div:not(#example) {
color: red;
}

25
Q

Aspect-ratio

A
26
Q

Targeting elements within elements

A

use <

Code:
nav > ul {

}

27
Q

Action attribute on a form element

A

The URI of a program that processes the form information. This value can be overridden by a formaction attribute on a or element.

28
Q

Method attribute on a form element

A

The HTTP method that the browser uses to submit the form. Possible values are:

post: Corresponds to the HTTP POST method ; form data are included in the body of the form and sent to the server.
get: Corresponds to the HTTP GET method; form data are appended to the action attribute URI with a ‘?’ as separator, and the resulting URI is sent to the server. Use this method when the form has no side-effects and contains only ASCII characters.
dialog: Use when the form is inside a element to close the dialog when submitted.
This value can be overridden by a formmethod attribute on a or element.

29
Q

Role attribute

A

Indicates a purpose behind an element on a page to assistive technologies

30
Q

Aria-labelledby

A
31
Q

linking to a page within the website

A

href=”#css-questions”

32
Q

name attributes

A
33
Q

Placeholder text

A

sometimes not always the best to do this since people may think that there is already text there

34
Q

span element

A
35
Q

linking inputs to labels

A

had to put id and name

36
Q

link in a text

A

Code:

<a></a>