## :after 選擇器
### 定義和用法
:after選擇器向選定的元素之后插入內容。
:after是偽元素,并且它生成包含放置在元素中的內容之后的生成內容的偽元素。
使用[content](https://www.w3cschool.cn/cssref/pr-gen-content.html) 屬性來指定要插入的內容。
默認情況下,此偽元素是內聯的,但是可以使用屬性顯示更改。
**例子:**
~~~
a.external:after {content: " " url(image.gif);)
p:after {content: " | ";}
~~~
## 實例1--每個元素之后插入內容:
```
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>W3Cschool教程(w3cschool.cn)</title>
<style>
p:after
{
content:"- 注意我";
}
</style>
</head>
<body>
<p>我的名字是 Donald</p>
<p>我住在 Ducksburg</p>
<p><b>注意:</b> :after在IE8中運行,必須聲明!DOCTYPE </p>
</body>
</html>
```
## 實例2--在每個 之后插入的內容和樣式:
```
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>W3Cschool教程(w3cschool.cn)</title>
<style>
p:after
{
content:"- Remember this";
background-color:yellow;
color:red;
font-weight:bold;
}
</style>
</head>
<body>
<p>My name is Donald</p>
<p>I live in Ducksburg</p>
<p><b>注意:</b>:after作用于IE8 以及更早版本的瀏覽器,DOCTYPE 必須已經聲明.</p>
</body>
</html>
```
- CSS常用樣式控制
- background--背景
- Text--文本
- CSS屬性
- align-*
- animation-*
- appearance
- backface-visibility
- background
- background-attachment
- background-blend-mode
- background-clip
- background-color
- background-image
- background-origin
- background-position
- background-repeat
- background-size
- border
- border-bottom
- border-bottom-color
- border-bottom-left-radius
- border-bottom-right-radius
- border-bottom-style
- border-bottom-width
- border-collapse
- border-color
- border-image
- border-image-outset
- border-image-repeat
- border-image-source
- border-image-width
- Border-left
- border-left-color
- border-left-style
- border-left-width
- border-image-slice
- border-radius
- border-right
- border-right-color
- border-right-style
- border-right-width
- border-spacing
- border-style
- border-top
- border-top-color
- border-top-left-radius
- border-top-right-radius
- border-top-style
- border-top-width
- border-width
- bottom
- box-shadow
- box-sizing
- caption-side
- clear
- clip
- color
- column-count
- column-gap
- column-rule
- column-rule-color
- column-rule-style
- column-rule-width
- column-span
- column-width
- columns
- content
- counter-increment
- counter-reset
- cursor
- direction
- display
- Empty-cells
- filter(濾鏡)
- CSS 偽元素選擇器
- :active 選擇器
- :after 選擇器
- :before 選擇器
- :checked 選擇器
- :disabled 選擇器
- :empty 選擇器
- :enabled 選擇器
- :first-child 偽元素
- :first-letter 偽元素
- :first-line 偽元素
- :first-of-type 選擇器
- :focus 選擇器
- :hover 選擇器