CSS ì íì (Selector (CSS))
CSS ì íìë ê·ì¹ì´ ì¼ì¹íë 문ìì ìì를 ì¤ëª íë CSS ê·ì¹ì ì¼ë¶ì ëë¤. ì¼ì¹íë ììë ê·ì¹ì ì§ì ë ì¤íì¼ì´ ì ì©ë©ëë¤.
ìì
ì´ CSS를 ìê°í´ë³´ì¸ì.
p {
color: green;
}
div.warning {
width: 100%;
border: 2px solid yellow;
color: white;
background-color: darkred;
padding: 0.8em 0.8em 0.6em;
}
#customized {
font:
16px Lucida Grande,
Arial,
Helvetica,
sans-serif;
}
ì´ ì íìë¤ì "p" (<p> ìì ë´ë¶ í
ì¤í¸ì ë
¹ìì ì ì©), "div.warning" (class "warning"ì´ ìë 모ë <div> ììë ê²½ê³ ììì²ë¼ ë³´ì) ë° "#customized" (IDê° "customized"ì¸ ììì 기본 ê¸ê¼´ì 16í½ì
í¬ê¸°ì Lucida Grande ëë ëª ê°ì§ ëì²´ ê¸ê¼´ ì¤ íëë¡ ì¤ì ) ì
ëë¤.
ê·¸ë° ë¤ì, ì´ CSS를 ë¤ìê³¼ ê°ì ì¼ë¶ HTMLì ì ì©í ì ììµëë¤.
<p>This is happy text.</p>
<div class="warning">
Be careful! There are wizards present, and they are quick to anger!
</div>
<div id="customized">
<p>This is happy text.</p>
<div class="warning">
Be careful! There are wizards present, and they are quick to anger!
</div>
</div>
ê²°ê³¼ íì´ì§ ì½í ì¸ ì ì¤íì¼ì ë¤ìê³¼ ê°ìµëë¤.
ê°ì´ 보기
-
CSS ìê°ìì CSS ì íìì ëí´ ë ìì보기
-
기본 ì íì
- íì
ì íì
elementname - í´ëì¤ ì íì
.classname - ID ì íì
#idname - ë²ì© ì íì
* ns|* *|* - ìì± ì íì
[attr=value] - ìí ì íì
a:active, a:visited
- íì
ì íì
-
그룹í ì íì
- ì íì 목ë¡
A, B
- ì íì 목ë¡
-
ê²°í©ì
- ì¸ì íì ì íì
A + B - ì¼ë° íì ì íì
A ~ B - ìì ì íì
A > B - íì ì íì
A B
- ì¸ì íì ì íì
-
ìì¬ ìì