---
title: "Discussion on \"CSS Hacks: What is ::before and ::after?\" | Hashnode"
description: "Discussion on \"CSS Hacks: What is ::before and ::after?\". ::before and ::after are CSS pseudo elements. They can add content before or after that element. This is the syntax\n.class::after {\n  content: \"some content\"\n}\nThis can be used with pseudo classes to add content when an event occurs. In the example b..."
url: "https://hashnode.com/posts/css-hacks-what-is-before-and-after/61dd990e6226ab4f74bef8da"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [CSS Hacks: What is ::before and ::after?](https://johnpalmgren.hashnode.dev/css-hacks-what-is-before-and-after?utm_source=hashnode&utm_medium=feed)

::before and ::after are CSS pseudo elements. They can add content before or after that element. This is the syntax .class::after { content: "some content" } This can be used with pseudo classes to add content when an event occurs. In the example b...

Jan 11, 2022 · 1 min read · johnpalmgren.hashnode.dev  
Read the article

-   [#css](https://hashnode.com/tag/css)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#webdev](https://hashnode.com/tag/webdev)
-   [#codenewbies](https://hashnode.com/tag/codenewbies)
-   [#beginners](https://hashnode.com/tag/beginners)

## Written by

[John Palmgren](https://hashnode.com/@JohnPalmgren)

@JohnPalmgren · UK

  
[View profile](https://hashnode.com/@JohnPalmgren)

Hello you wonderful people. I'm a self-taught web developer and I want to share my journey with you. I'm currently doing a webdev Bootcamp and I will be sharing my insights here as well tutorials on what I'm learning. I have a writing degree and I'm excited about exploring the intersection between technology and writing.

## Responses 1

Markdown supported · ⌘↵ to post

[Marcin Sarniak](https://hashnode.com/@cryptic)

[Jan 11, 2022](https://hashnode.com/posts/css-hacks-what-is-before-and-after/61dd990e6226ab4f74bef8da/comment/61dde0604e70945324c584c5)

Nice and simple explanation.

[John Palmgren](https://hashnode.com/@JohnPalmgren)

[Jan 11, 2022](https://hashnode.com/posts/css-hacks-what-is-before-and-after/61dd990e6226ab4f74bef8da/comment/61dde0604e70945324c584c5#reply-61de102044f1964f4fa7de10)

I'm glad it was helpful 😌
