DEV Community

Cover image for TIL - CSS Basics
Anne Quinkenstein
Anne Quinkenstein

Posted on • Edited on

1

TIL - CSS Basics

HTML is styled with Cascading Style Sheets - it is commenly "called" in a HTML file.

CSS- Property

my-selector {
property: value;
property: value;
}

List of CSS properties

Prioritisation depending on how the CSS is called:

  1. CSS inline (highest priority) ;
  2. CSS in internal stylesheet ;
  3. CSS in external stylesheet
    • last CSS file called has priority
    • -> external stylesheet is king. seperate HTML + CSS!

Pseudo-classes

List of Pseudo-Classes

Pseudo-classes

Stylize a particular state
- :link – A link the user has never visited.
- :visited – A link the user has visited before.
- :hover – A link with the user’s mouse over it.
- :active – A link that’s being pressed down by a mouse (or finger).

Structure
:first-child, :nth-child , :first-of-type, :nth-of-type

CSS GAME

first step

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay