WDD 230: Web Frontend Development I

CSS Pseudo-elements

Overview

Like pseudo-classes, CSS pseudo-elements provide additional versatility when working with HTML and CSS in a dynamic environment. Pseudo-elements allow us to modify specific parts of elements including directly before and after the element's text node.

"A CSS pseudo-element is a keyword added to a selector that lets you style a specific part of the selected element(s). For example, ::first-line can be used to change the font of the first line of a paragraph." - MDN

Prepare

Activity Instructions

  1. Fork the CodePen to your own CodePen account.
  2. Add a marker pseudo-element to the CSS.
  3. In the marker rule, add declarations to change the ordered list's numbers
    1. color (navy),
    2. font-size (2rem), and
    3. font-variant (small-caps).
  4. Add a before pseudo-element to add a dark checkbox emoji ☑️ to the front of the ordered list items.
    Built in OS Emojis • MS Windows • Mac - use the fn key

Screenshot of pseudo-element learning activity CodePen example.
Figure 1: Screenshot of Pseudo-Element CodePen

Submission

  1. Update your home portal page with a link to your CodePen activity.
  2. Commit and post your updates to your wdd230 GitHub Pages repository.