μ΄λ² ν¬μ€ν μμλ μλ μ리먼νΈλ€μ λν΄μ μμ보λλ‘ νκ² μ΅λλ€.
μ΄λ μλ€μ μλ ν΄λμ€μ λΉμ·ν λ μλ€μ λλ€.
μ΄λ¦ λ§κ³ λ λ€λ₯Έκ² μμ΄λ³΄μ΄λ€μ. ( μ¬μ€ μ λ μ λͺ°λΌμ ...γ γ γ )
λ¬Έλ²λ μλ ν΄λμ€μ λμΌν΄λ³΄μ λλ€.
selector:pseudo-element {property: value}
|
CSS ν΄λμ€μ ν¨κ» μ°μ΄κΈ°λ νμ£ .
selector.class:pseudo-element {property: value}
|
κ°μ₯ λ§μ΄ μ¬μ©λλ pseudo-elementsμλ λ€μκ³Ό κ°μ κ²λ€μ΄ μμ΅λλ€.
| Value | Description |
|---|---|
| :first-line | Use this element to add special styles to the first line of the text in a selector. |
| :first-letter | Use this element to add special style to the first letter of the text in a selector. |
| :before | Use this element to insert some content before an element. |
| :after | Use this element to insert some content after an element. |
The :first-line pseudo-element
Following is the example which demonstrates how to use :first-line element to add special effect to the first line of elements in the document .
<style type="text/css">
p:first-line { text-decoration: underline; }
p.noline:first-line { text-decoration: none; }
</style>
<p class="noline"> This line would not have any underline
because this belongs to nline class.</p>
<p>The first line of this paragraph will be underlined
as defined in the CSS rule above. Rest of the lines in this
paragraph will remain normal. This example shows how to use
:first-line pseduo element to give effect to the first line
of any HTML element.</p>
|
κ²°κ³Όλ μλμ κ°μ΅λλ€.
The :first-letter pseudo-element
Following is the example which demonstrates how to use :first-letter element to add special effect to the first letter of elements in the document .
<style type="text/css">
p:first-letter { font-size: 3em; text-color:red; }
p.normal:first-letter { font-size: 10px; }
</style>
<p class="normal"> First character of this paragraph will
be normal and will have font size 10 px;</p>
<p>The first character of this paragraph will be 3em big
and in red color as defined in the CSS rule above. Rest of the
characters in this paragraph will remain normal. This example
shows how to use :first-letter pseduo element to give effect to
the first characters of any HTML element.</p>
|
κ²°κ³Όλ μλμ κ°μ΅λλ€.
The :before pseudo-element
Following is the example which demonstrates how to use :before element to add some content before any element .
<style type="text/css">
p:before
{
content: url(/images/bullet.gif)
}
</style>
<p> This line will be preceded by a bullet.</p>
<p> This line will be preceded by a bullet.</p>
<p> This line will be preceded by a bullet.</p>
|
κ²°κ³Όλ μλμ κ°μ΅λλ€.
The :after pseudo-element
Following is the example which demonstrates how to use :after element to add some content after any element .
<style type="text/css">
p:after
{
content: url(/images/bullet.gif)
}
</style>
<p> This line will be succeeded by a bullet.</p>
<p> This line will be succeeded by a bullet.</p>
<p> This line will be succeeded by a bullet.</p>
|
κ²°κ³Όλ μλμ κ°μ΅λλ€.
μμ νμ΄μ§ λ§λ€μ΄μ μ§μ ν μ€νΈ ν΄λ³΄λ κ² μμ§ λ§μΈμ.!!!! ^-^
Reference : http://www.tutorialspoint.com/css/css_pseudo_elements.htm
'π» Programming > CSS' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
| [CSS] 26. Filters - Texts and Image Effects ( ν μ€νΈ, μ΄λ―Έμ§ ν¨κ³Ό ) (0) | 2016.06.12 |
|---|---|
| [CSS] 25. @ Rules ( @ κ·μΉλ€ ) (0) | 2016.06.12 |
| [CSS] 23. Pseudo Classes ( μλ ν΄λμ€ ) (0) | 2016.06.12 |
| [CSS] 22. Layers ( λ μ΄μ΄ ) (0) | 2016.06.12 |
| [CSS] 21. Positioning ( ν¬μ§μ λ, μμΉ ) (0) | 2016.06.12 |