1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <style type="text/css"> .item{ color: blue; } /* **** */ #list2> li { color: gray; } /* 6. 자손 선택자, Descendant Selector - 조상을 조건으로 해서 자손을 검색 - 조상선택자 자손선택자 {} */ /* tbody의 존재 기억하기!! */ #tbl1 > tbody> tr> td { color: blue; } /* 생략가능., 더 유용 */ #tbl2 td { color: red; } #tbl1.tables td { color: red; } </style> </head> <body> <!-- ex06.htm --> [연습 : 선택자] <ul> <li class="item">강아지</li> <li class="item">고양이</li> <li class="item">병아리</li> </ul> <ul id="list2"> <li>자바</li> <li>닷넷</li> <li>델파이</li> </ul> <hr /> <table id="tbl1" class="tables"> <tr> <td>항목</td> <td>항목</td> <td>항목</td> </tr> <tr> <td>항목</td> <td>항목</td> <td>항목</td> </tr> <tr> <td>항목</td> <td>항목</td> <td>항목</td> </tr> </table> <table id="tbl2"> <tr> <td>항목</td> <td>항목</td> <td>항목</td> </tr> <tr> <td>항목</td> <td>항목</td> <td>항목</td> </tr> <tr> <td>항목</td> <td>항목</td> <td>항목</td> </tr> </table> <hr /> <!-- 테이블의 원형 --> <table border="1"> <thead> <tr> <th>제목</th> </tr> </thead> <tbody> <tr> <th>내용</th> </tr> </tbody> <tfoot> <tr> <th>비고</th> </tr> </tfoot> </table> </body> </html> | cs |
'WEB > CSS' 카테고리의 다른 글
속성 선택자 / zen coding(emmet) / PCDATA (0) | 2016.01.22 |
---|---|
인접 형제 선택자, 형제 선택자 (0) | 2016.01.22 |
그룹 선택자, 자식 선택자 (0) | 2016.01.22 |
ID 선택자, 클래스 선택자 (0) | 2016.01.22 |
css 적용방식 (0) | 2016.01.22 |