반응형
nesting
-
Sass(SCSS) 기본 공부 3 중첩HTML5_CSS3/sass 2023. 4. 6. 02:23
Sass(SCSS) 기본 공부 1 https://raim-2.tistory.com/17 Sass(SCSS) 기본 공부 2 https://raim-2.tistory.com/18 Sass/SCSS 중첩 (Nesting) Sass에서는 중첩이 가능하다. 중첩은 일반 CSS보다 더 깔끔하고, 구조 및 선택자 파악이 쉽다는 장점이 있다. 첫번째 두번째 1. 중첩 사용방법 중첩을 사용하는 방법은 간단하다. 아래 예시처럼 중첩하고 싶은 만큼 대괄호 {} 안에 자식 선택자를 넣으면 된다. $txt_color:#fff; $bg_color : background-color; $font_size : 18px; $my_border : 1px solid #ddd; ul{ li { #{$bg_color} : black; bord..