Skip to content

Commit 252ce16

Browse files
authored
Update Collection-of-CSS-Questions.md
Notice the double colon notation - ::first-line versus :first-line The double-colon replaced the single-colon notation for pseudo-elements in CSS3. This was an attempt from W3C to distinguish between pseudo-classes and pseudo-elements. The single-colon syntax was used for both pseudo-classes and pseudo-elements in CSS2 and CSS1. For backward compatibility, the single-colon syntax is acceptable for CSS2 and CSS1 pseudo-elements.
1 parent b2ad445 commit 252ce16

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CSS/Collection-of-CSS-Questions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,9 @@ For example with this selector `p span`, browsers firstly find all the `<span>`
363363

364364
### Describe pseudo-elements and discuss what they are used for.
365365

366-
A CSS pseudo-element is a keyword added to a selector that lets you style a specific part of the selected element(s). They can be used for decoration (`:first-line`, `:first-letter`) or adding elements to the markup (combined with `content: ...`) without having to modify the markup (`:before`, `:after`).
366+
A CSS pseudo-element is a keyword added to a selector that lets you style a specific part of the selected element(s). They can be used for decoration (`::first-line`, `::first-letter`) or adding elements to the markup (combined with `content: ...`) without having to modify the markup (`:before`, `:after`).
367367

368-
- `:first-line` and `:first-letter` can be used to decorate text.
368+
- `::first-line` and `::first-letter` can be used to decorate text.
369369
- Used in the `.clearfix` hack as shown above to add a zero-space element with `clear: both`.
370370
- Triangular arrows in tooltips use `:before` and `:after`. Encourages separation of concerns because the triangle is considered part of styling and not really the DOM.
371371

0 commit comments

Comments
 (0)