Advanced CSS Flashcards

1
Q

What does the CSS position property determine?

A

The CSS position property determines how an element is positioned within the document. The top, right, bottom, and left properties define the specific placement.

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

What are the five position types in CSS?

A

Static: Default; positioned according to normal document flow.
Relative: Positioned relative to its normal position; offsets can be applied.
Absolute: Positioned relative to the nearest positioned ancestor; removed from normal flow.
Fixed: Positioned relative to the viewport; does not move when scrolling.
Sticky: Toggles between relative and fixed based on scroll position.

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

What are media queries used for in CSS?

A

Media queries enable responsive design by applying styles based on device characteristics, like width or resolution.

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

How can media queries be used in CSS?

A

Apply styles conditionally with @media and @import.
Target specific media with the media= attribute.
Detect media states using JavaScript (e.g., matchMedia()).

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

What are common media query breakpoints and their associated devices?

A

320px–480px: Mobile devices
481px–768px: Tablets
769px–1024px: Small screens, laptops
1025px–1200px: Desktops
1201px+: TVs and extra-large screens

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

What is CSS Grid Layout?

A

CSS Grid Layout is a two-dimensional layout system for arranging items in rows and columns.

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

What are the features of CSS Grid?

A

Grid Template (Columns, Rows)
Auto Rows and Columns
Gap and Lines
Justify Items

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

What is CSS Flexbox?

A

CSS Flexbox is a one-dimensional layout system for efficiently aligning items in containers.

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

What are the key features of Flexbox?

A

Flexibility in space distribution
Arrangement and alignment of items
Control over order and spacing

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

What are the main Flexbox properties?

A

Direction: Defines the main-axis (row or column layout).
Wrap: Controls whether items wrap or stay on one line.

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

What does CSS animation do?

A

CSS animations allow dynamic transitions between states using the @keyframes rule.

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

Name a few examples of CSS animations.

A

2D Transform – Translate
2D Transform – Rotate
3D Transform – TranslateX

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

What is the @keyframes rule used for?

A

The @keyframes rule defines animation states, allowing transitions like changing a div’s background color gradually from red to yellow in 4 seconds.

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

What are CSS gradients used for?

A

CSS gradients provide smooth transitions between colors.

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

What are the types of CSS gradients?

A

Linear: Moves in a specific direction (e.g., top, left, diagonal).
Radial: Expands from a center point.
Conic: Rotates around a center point.

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

Give an example of a linear gradient in CSS.

A

A linear gradient transitioning from red to green starting at the top.