CSS, SCSS Flashcards

1
Q

Pseudo-element that is the first/last child of the selected element. It is often used to <b>add cosmetic content</b> to an element.

A

::before, ::after

example:

a::after {
content: “→”;
}

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

what is overflow and what are the kinds

A

The overflow shorthand CSS property sets what to do when an element’s content is too big to fit in its block formatting context. It is a shorthand for overflow-x and overflow-y.

/* Keyword values */

overflow: visible;
overflow: hidden;
overflow: clip;
overflow: scroll;
overflow: auto;
overflow: hidden visible;

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

Placing span at a specific position in div

A

Span is not a block level element, so you can’t position it relative to another element.

Make it a div with style
position:absolute;

then, for example:
right:0;
bottom:0;
text-align:right’

Make sure that the containing div has style=”position:relative;” to contain the absolute object.

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

What is aria-hidden=”true”?

A

Adding aria-hidden=”true” to an element removes that element and all of its children from the accessibility tree. This can improve the experience for assistive technology users by hiding:

purely decorative content, such as icons or images
duplicated content, such as repeated text
offscreen or collapsed content, such as menus
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a white-space CSS property and what are the kinds?

A

The white-space CSS property sets how white space inside an element is handled.

white-space: normal;
white-space: nowrap;
white-space: pre;
white-space: pre-wrap;
white-space: pre-line;
white-space: break-spaces;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to change cursor?

A

cursor: pointer;
cursor: auto;

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

How to detect a touch device with only CSS?

A
/* smartphones, touchscreens */
@media (hover: none) and (pointer: coarse) {
    /* ... */
}
/* stylus-based screens */
@media (hover: none) and (pointer: fine) {
    /* ... */
}
/* Nintendo Wii controller, Microsoft Kinect */
@media (hover: hover) and (pointer: coarse) {
    /* ... */
}
/* mouse, touch pad */
@media (hover: hover) and (pointer: fine) {
    /* ... */
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How to hide something behind the right screen edge?

A
#Sidebar {
    position: fixed;
    width: 30%;
    height: 100%;
    top: 0;
    right: 0;
    transform: translateX(100%);
    border: 1px solid red;
    transition: transform 5s; /* This is slow for demonstration purposes */
}
#Sidebar.open {
    transform: translateX(0);
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to flip text vertically?

A

transform: rotate(270deg);

transform-origin: right bottom 0;

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

How to align icon <i>?</i>

A

top: 5px;
left: 5px;

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

How to make a dot in css?

A

<span></span>

.dot {
  height: 25px;
  width: 25px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

underline below span?

A

border-bottom: 2px solid $blue;

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