::after {
    content: /* value */;
    /* 가상 요소를 스타일할 속성들 */
}
p::after {
    content: "👉";
    vertical-align: 0.2em;
    margin-left: 0.3em;
}
<p>
    문단의 콘텐츠입니다.
</p>
실제 적용된 모습
<p>
    문단의 콘텐츠입니다.
    <after>👉</after> <!-- <after>라는 태그는 없습니다. 설명을 돕기위해 가상으로 마크업한 것입니다. -->
</p>
button::after {
    content: "🧡";
}
<button type="button"></button>
실제 적용된 모습
<button type="button" aria-label="좋아요!"></button>
실제 적용된 모습
h2::after {
    content: ""; /* <= 여기를 주목하세요. */
    display: block;
    width: 2em;
    height: 0.3em;
    background-color: #000;
    margin-top: 0.3em;
}
<h2>가상 요소 선택자</h2>
input::after {
    content: "🧡";
}
img::after {
    content: "🧡";
}

마지막 업데이트 정보: 2024-03-09

::after 가상 요소 선택자의 Animation과 transition 속성의 지원
데스크탑
속성
데스크탑 Chrome
Chrome
데스크탑데스크탑 Edge
Edge
데스크탑 Firefox
Firefox
Safari
Safari
Animationtransition 지원 26 12 4 지원하지 않음

마지막 업데이트 정보: 2024-03-09

::after 가상 요소 선택자의 Animation과 transition 속성의 지원
모바일
속성
모바일 Chrome
Chrome
모바일 Firefox
Firefox
Safari
Safari
Animationtransition 지원 26 4 지원하지 않음
<nav>
    <ul>
        <li><a href="">제품 보기</a></li>
        <li><a href="">개인정보처리방침</a></li>
        <li><a href="">고객센터</a></li>
    </ul>
</nav>
ul {
    display: flex;
    margin: 0;
    padding: 0;
}
li {
    list-style: none;
}
a {
    color: inherit;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
li:not(:last-child)::after {
    content: "";
    display: inline-block;
    width: 1px;
    height: 0.8em;
    background-color: rgba(0, 0, 0, .6);
    margin: 0 1.1em;
    vertical-align: -0.06em;
    white-space: nowrap;
}
실제 적용된 모습
<a href="">앞으로 가기</a>
a {
    color: inherit;
    text-decoration: none;
    padding: 0.5em 1em;
    background-color: #fff;
    border: 1px solid #777;
    border-radius: 0.5em;
    display: inline-flex;
    align-items: center;
}
a::after {
    content: "";
    display: inline-flex;
    width: 0.5em;
    height: 0.5em;
    border-left: 1px solid black;
    border-bottom: 1px solid black;
    transform: rotateZ(225deg);
    margin-left: 0.2em;
}
실제 적용된 모습
::after 가상 요소 선택자의 브라우저 호환성
선택자
데스크탑 Chrome
Chrome
데스크탑데스크탑 Edge
Edge
데스크탑 Firefox
Firefox
Safari
Safari
::after 1 12 1.5 4