CSS Almanac- Selectors Flashcards

1
Q

CSS Selectors

A

CSS selectors are patterns used to select elements in the DOM.

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

CSS Properties

A

CSS properties style elements through their values.

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

A pseudo element which allows you to insert content after any other content onto a page from CSS (without needing to be in the HTML)

A

::after

preview:

CSS
div::after {
content: “hi”;
}

HTML

<div>

hi
</div>

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

A pseudo element which allows you to insert content before any other content onto a page from CSS (without needing to be in the HTML)

A

::before

  • The value for content can be:

A string: content: “a string”;
An image: content: url(/path/to/image.jpg);
Nothing: content: “”; - Useful for clearfix and inserting images as background-images
A counter: content: counter(li); - Really useful for styling lists until :marker comes along.

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

A pseudo selector changes the appearance of a link while it is being activated (being clicked on or otherwise activated). It’s usually only seen for a split second, and provides visual feedback that the element was indeed clicked. It’s most typically used on anchor links (<a>).</a>

A

:active

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

The pseudo-class in CSS provides a method for selecting elements that are the source anchor of a hyperlink.

A

:any-link

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

What is adjacent sibling?

A

A combinator selector. A way of combining two selectors.

eg.)

p + p {
margin: 0;
}

selects two paragraph tags that is directly after another paragraph tag (with nothing in between)

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