Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Creating Effects with Decorative Pseudo-Elements | Adding Decorative Effects with CSS
CSS Fundamentals
course content

Contenu du cours

CSS Fundamentals

CSS Fundamentals

1. Getting Started with CSS
2. Styling Text in CSS
3. The CSS Box Model & Spacing Elements
4. Mastering Flexbox for Layouts
5. Adding Decorative Effects with CSS

book
Creating Effects with Decorative Pseudo-Elements

Pseudo-elements ::before and ::after are special selectors that allow us to insert content before or after an element's content. We use them to add decorative elements, such as icons or borders, to an element's content without modifying the actual HTML content.

css
  • ::before adds the content before the element content;
  • ::after adds the content after the element content.

Let's consider the following example, where our task is to add some decoration for the hover effect on the links:

html

index.html

css

index.css

copy

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 5. Chapitre 4
Nous sommes désolés de vous informer que quelque chose s'est mal passé. Qu'est-il arrivé ?
some-alt