기록
새로 알게 된 css 본문
1. only-of-type
사용했던 예시)
.abc p img:only-of-type {
width: 100%;
}
p 태그 안에 img 태그가 유일한 타입일 경우 width 100% 주기
2. width: min-content
width가 담긴 컨텐트의 길이만큼만
.a {
width: min-content !important;
}
3. all: unset
현재 부여된 스타일을 모두 초기화시킨다.
4. first-child:nth-last-child(1)
li:first-child:nth-last-child(1) {
width: 100%;
}
특정 경우에 자식 태그가 1개일 경우에만 width: 100%;을 주고 싶을 때
'TIL*' 카테고리의 다른 글
[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. +) addEventListener passive (0) | 2022.03.02 |
---|---|
jquery prop() & attr() (0) | 2022.03.02 |
KeyboardEvent.isComposing (0) | 2022.02.11 |
JavaScript parseInt() vs Number() (0) | 2022.02.04 |
mern stack 복습 - 1 (0) | 2022.01.25 |
Comments