728x90
반응형
배경으로 이미지를 넣을 때 세밀하게 위치 조정이 필요한 경우
아래와 같은 방법으로 응용해서 쓴다.
.content {background-position: left 15px top 20px;}
.content {background-position: left 15px center;}
.content {background-position: right 20px top;}
재밌는건 calc로도 지정이 가능하다 ㅎㅎ
.content {background-position: left calc(100% - 20px) center;}
** background 속기법
.content {
background: url(../img/icon/angle_thin_right.svg) no-repeat right calc(100% - 45px) center / cover;
}
// 배경 컬러랑 같이 쓰일 때
.content {
background: url(../img/icon/angle_thin_right.svg) no-repeat right calc(100% - 45px) center / cover, #fff;
}
728x90
반응형
'실전 코딩 > CSS' 카테고리의 다른 글
마우스 드래그 스타일 바꾸기 (0) | 2022.12.28 |
---|---|
텍스트에 하늘색 영역 생길 때 없애는 속성 (0) | 2022.10.25 |
toggle button (0) | 2022.06.07 |
input[type="file"] 커스텀(custom)하는 방법 (0) | 2022.06.07 |
넘치는 글자 ...으로 처리하기 (0) | 2021.09.06 |
댓글