CodingGita — CSS Selectors Lab

Assignment 1: Practice with different selectors

Overview

This page is made to practice different CSS selectors.

This text should look gray or lighter.

Class Selector

This paragraph is highlighted using a class.

Specificity Example

This paragraph uses the highlight-text class.

This one uses the same class, but also an ID — ID should win.

Descendant & Child Selector

Section heading (style me using child selector)

Paragraph inside a section.

Adjacent Sibling Selector

Heading before paragraph

This paragraph should look different since it comes right after h4.

Attribute Selector

Image with alt Another image with alt

nth-child Selector