728x90
반응형
.wrap-type1 { padding: 1.6rem; } 안에 요소를 하나만 제외시키고 싶을땐?
방법 1: margin을 이용한 보정
.wrap-type1 {
padding: 1.6rem;
}
.wrap-type1 .exclude-padding {
margin: -1.6rem;
}
방법 2: position: absolute 사용 (상황에 따라)
.wrap-type1 {
position: relative;
padding: 1.6rem;
}
.wrap-type1 .exclude-padding {
position: absolute;
top: 0;
left: 0;
right: 0;
}
방법 3: padding을 특정 요소에만 적용
.wrap-type1 {
display: flex;
}
.wrap-type1 > *:not(.exclude-padding) {
padding: 1.6rem;
}
728x90
반응형
'Front > CSS' 카테고리의 다른 글
[CSS] pointer-events (0) | 2025.07.03 |
---|---|
[CSS] grid-template-columns (0) | 2025.04.24 |
[CSS] zindex가 똑같은 요소는 어떤게 위로 표시가 되나요 ? (0) | 2025.02.11 |
[CSS] rem단위 (0) | 2024.08.06 |
[CSS] visibility : 요소를 숨기고 공간은 그대로 유지하기 (0) | 2024.07.20 |