Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- 업무시유용한git
- zsh설치
- .bash_profile적용안됨
- 코알못의도전 #알고리즘기초 #공부하는블로그
- multiple
- @at-root여러번
- @at-root
- .bash_profile실행
- git 팁
- 유용꿀gittip
- 카드 셔플
- 해시 #map&set
- leetCode #코알못의도전기 #코드알고리즘기초 #1일1알고리즘 #알고리즘공부 #코드챌린지
- zsh설치 후
- ngrok
Archives
- Today
- Total
흑염소처럼
Scss $i 변수 @for문에 사용하기 본문
@for $i from 1 through 11{
.spread .card_bind:nth-child(#{$i}) {
left: 80*($i - 1px);
top: 0px;
}
}
#{$i}는 문자열로 받게 되고
$i는 변수로 받게된다.
아래와 같이 css가 노출이 된다.
.spread .card_bind:nth-child(1) {
left: 0px;
top: 0px;
}
.spread .card_bind:nth-child(2) {
left: 80px;
top: 0px;
}
.spread .card_bind:nth-child(3) {
left: 160px;
top: 0px;
}
.spread .card_bind:nth-child(4) {
left: 240px;
top: 0px;
}
.spread .card_bind:nth-child(5) {
left: 320px;
top: 0px;
}
.spread .card_bind:nth-child(6) {
left: 400px;
top: 0px;
}
.spread .card_bind:nth-child(7) {
left: 480px;
top: 0px;
}
.spread .card_bind:nth-child(8) {
left: 560px;
top: 0px;
}
.spread .card_bind:nth-child(9) {
left: 640px;
top: 0px;
}
.spread .card_bind:nth-child(10) {
left: 720px;
top: 0px;
}
.spread .card_bind:nth-child(11) {
left: 800px;
top: 0px;
}
'scss' 카테고리의 다른 글
@at-root 여러번 사용 (0) | 2021.01.13 |
---|---|
원하는 태그만 선택적으로 reset.scss 만들기 (0) | 2020.08.26 |
[SCSS Rule] 변수 선언하기 @for @function @each unquote($string) (0) | 2020.08.10 |
Comments