---
title: "Discussion on \"#71 CSS 偽元素的妙用：「::before」 與「::after」的常見用法\" | Hashnode"
description: "Discussion on \"#71 CSS 偽元素的妙用：「::before」 與「::after」的常見用法\". ⚠️ 本篇文章已搬遷至 css.im1010ioio.dev，請至新站閱讀完整版。\n\n\n之前寫的文章，雖然有提到過，但是居然沒有好好地解釋過 CSS 的偽元素（Pseudo），也就是 ::before 與 ::after。這超級實用的，怎麼能沒有呢？所以今天就來好好地認識一下它們吧！\n它們用在不修改 HTML 的情況下加入裝飾性內容，是前端開發的必備技能。\n::before 與 ::after，簡單來說，就像是你在 HTML 元素的前後，額外加上了兩個裝飾用的「影子」元素。而且，你完全不需要去動..."
url: "https://hashnode.com/posts/css-pseudo-before-after/68d17012a4b53c6f701b008a"
---

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

Discussion

# [#71 CSS 偽元素的妙用：「::before」 與「::after」的常見用法](https://im1010ioio.hashnode.dev/css-pseudo-before-after?utm_source=hashnode&utm_medium=feed)

⚠️ 本篇文章已搬遷至 css.im1010ioio.dev，請至新站閱讀完整版。 之前寫的文章，雖然有提到過，但是居然沒有好好地解釋過 CSS 的偽元素（Pseudo），也就是 ::before 與 ::after。這超級實用的，怎麼能沒有呢？所以今天就來好好地認識一下它們吧！ 它們用在不修改 HTML 的情況下加入裝飾性內容，是前端開發的必備技能。 ::before 與 ::after，簡單來說，就像是你在 HTML 元素的前後，額外加上了兩個裝飾用的「影子」元素。而且，你完全不需要去動...

Sep 22, 2025 · 1 min read · im1010ioio.hashnode.dev  
Updated Feb 5  
Read the article

-   [#css](https://hashnode.com/tag/css)
-   [#css3](https://hashnode.com/tag/css3)
-   [#pseudo-elements](https://hashnode.com/tag/pseudo-elements)
-   [#pseudo-classes](https://hashnode.com/tag/pseudo-classes)
-   [#pseudo-classes-in-css](https://hashnode.com/tag/pseudo-classes-in-css)
-   [#pseudo](https://hashnode.com/tag/pseudo)

## Written by

[YI-LIN CHEN (Eva)](https://hashnode.com/@im1010ioio)

@im1010ioio · Taipei, Taiwan

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

ғʀᴏɴᴛᴇɴᴅ ᴅᴇᴠᴇʟᴏᴘᴇʀ / ᴅᴇsɪɢɴᴇʀ / ᴄʀᴇᴀᴛᴏʀ

Chief Designer @HealthyPlate

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
