Simple Selectors
First heading: I am a light gray <h3> heading
Second heading: I am also a light gray <h3> heading
- I am an unorganized list
- We were all defined as light gray by the same type selector
Conditional At-rule
This sentence will only style red if the browser viewport width is at least 100px wide. This sentence will only style red if the browser viewport width is at least 5,000px wide
Class Selectors
I am a paragraph. I have two class names; "heavy" and "shocking." One selector made me bold by referencing "heavy." Another selector made me red by referencing "shocking."
ID Selectors
My unique ID is "y-paragraph." An ID selector made me yellow by calling this ID.
Presence, Value, & Substring Value Selectors
Here are some books on my bookshelf. These books have attributes: book-type (fiction, non-fiction, or textbook), cover-color (ex. hard-blue, soft-brown), and title-start, which
is the first two words of the title. All books in the list are tagged with the media="book" attribute value.
Fiction books have red font, non-fiction yellow, & textbooks green. Hardcover books have a black background & soft-cover purple backgrounds. Books with brown covers are in bold. Books with the media="book" attr/value are
italicized. Any book with "The" or "the" in the first two words is underlined.
- The Photographer's Eye
- Automate the Boring Stuff with Python
- The Earth Abides
- Hacker, Hoaxer, Whistle-blower, Spy: The Many Faces of Anonymous
- Practice Makes Perfect: Spanish Vocabulary
- The Age of Reason
Pseudo-classes
Hover over this link to get SPOOKED!!This link turns red after being clicked (unless you have history disabled)
Pseudo Elements
Note that this paragraph has some fancy styling.
This is thanks to pseudo elements. I can even use ::after to add this clonepa after this paragraph: