selector:hover {
background-color : pink;
border : solid 1px red;
}
태그 이름 | 클래스/아이디 | 자식(children) | 직속 자식(direct children) | 복수 선택 | 여러 조건 | Pseudo-class (가상 클래스)
<i> 태그
.div1 i { }
<i> 태그
.div1 > i { }
.two, .four { }
HTML
<p class="outside one">Outside 1</p>
CSS.outside .one { }
<p> 태그
중 3번째.div1 p:nth-child(3) {
color: blue;
}
<p> 태그
중 첫 번째.div1 p:first-child {
color: red;
}
<p> 태그
중 마지막.div1 p:last-child {
color: green;
}
<p> 태그
.div1 p:not(:last-child) {
font-size: 150%;
}
<p> 태그
.div1 p:not(:first-child) {
text-decoration: line-through;
}
display : flex;
justify-content : center;
프론트엔드 면접 질문
Q. CSS 내부 스타일 시트(style 태그안에 css 코드 작성)의 경우, head 안에 위치함. 그런데, 대개 JS의 script 태그는 body 안의 맨 끝에 위치함. 왜 script 태그의 위치는 바디 끝에 위치하는가?
--> (script 태그의 위치)