이번 ν¬μŠ€νŒ…μ—μ„œλŠ” μŠˆλ„ μ—˜λ¦¬λ¨ΌνŠΈλ“€μ— λŒ€ν•΄μ„œ μ•Œμ•„λ³΄λ„λ‘ ν•˜κ² μŠ΅λ‹ˆλ‹€.

 

이녀석듀은 μŠˆλ„ ν΄λž˜μŠ€μ™€ λΉ„μŠ·ν•œ λ…€μ„λ“€μž…λ‹ˆλ‹€.  

 

이름 λ§κ³ λŠ” λ‹€λ₯Έκ²Œ μ—†μ–΄λ³΄μ΄λ„€μš”. ( 사싀 저도 잘 λͺ°λΌμ„œ ...γ…‹γ…‹γ…‹ )

 

문법도 μŠˆλ„ ν΄λž˜μŠ€μ™€ λ™μΌν•΄λ³΄μž…λ‹ˆλ‹€.

selector:pseudo-element {property: value}

 

CSS ν΄λž˜μŠ€μ™€ ν•¨κ»˜ 쓰이기도 ν•˜μ£ .

selector.class:pseudo-element {property: value}

 

κ°€μž₯ 많이 μ‚¬μš©λ˜λŠ” pseudo-elementsμ—λŠ” λ‹€μŒκ³Ό 같은 것듀이 μžˆμŠ΅λ‹ˆλ‹€. 

ValueDescription
:first-lineUse this element to add special styles to the first line of the text in a selector.
:first-letterUse this element to add special style to the first letter of the text in a selector.
:beforeUse 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