728x90
SMALL
#css
Pseudo-elements select specific parts of an element.
::first-line
- ::first-line selects the first line of the element.
- For example, the following sets the text color of the first line of the p element to red.
p::first-line {
color: red;
}
::first-letter
- ::first-letter selects the first letter of the element.
- For example, the following sets the color of the first letter of the p element to red.
p::first-letter {
color: red;
}
::before
- ::before selects before the element.
- For example, the following puts the word xyz in front of the p element and makes it red.
p::before {
content: "xyz";
color: red;
}
::after
- ::after selects after the element.
- For example, the following puts the word xyz after the p element and sets the color to red.
p::after {
content: "xyz";
color: red;
}
::selection
- ::selection selects the text selected by mouse dragging etc.
#css grammar #css basic #css tag #css Pseudo-elements #Pseudo elements #Pseudo-elements #selector #css selector
728x90
LIST
'CSS' 카테고리의 다른 글
HTML CSS Javascript 주석 달기 및 단축키 (0) | 2023.06.12 |
---|---|
[CSS] CSS / Pseudo class (0) | 2022.08.17 |
[CSS] CSS / Adjacent Sibling Selector (0) | 2022.08.15 |
[CSS] CSS / Sibling Selector (0) | 2022.08.15 |
[CSS] CSS / Child Selector (0) | 2022.08.14 |