css (2) 썸네일형 리스트형 scss each문 html scss $backgrounds: ( home, 'homg.jpg'), ( about, 'about.jpg'); @each $id, $image in $backgrounds{ .target-#{$id} { background:url( $image ); background-size:100% auto; } } $background에 배열로 저장하고 each문에서 id값으로 이미지 설정 sass 사용법 sass 터미널 sass --style xxxxx scss:지정할 폴더/ :css/지정할 폴더/ xxxxx 적어놓은것은 컴파일 스타일 종류 컴파일 스타일 종류는 -nested : 뎁스별로 구분해서 컴파일-compac: 요소에 스타일이 속성을 한줄씩 정렬해서 컴파일-expanded: 요소에 모든 스타일을 한줄에 컴파일-compressed : 모든 요소를 공백없이 컴파일 -sass 변수 $font-color: red;$font-stack : Helvetica, sans-serif; body{font: 100% $font-stack;color: $font-color;} //import 상속 //작성 방법 : @import "파일명.scss" // 팁 파일명에 _붙여서 불러오면 css가 추가가 안된다.. //e.. 이전 1 다음