방법 1: position: absolute; + transform: rotate();
.parent {
display: relative;
}
.child {
position: absolute;
transform: rotate(-90deg);
top: 50;
left: 50px;
}
-
rotate하면 parent범위를 넘어서 위치가 많이 바뀜
-
조정하기 어려움
방법 2: position:absolute; + writing-mode: vertical-rl;
더보기
CSS syntax:
writing-mode: horizontal-tb | vertical-rl | vertical-lr ;
.parent {
position: relative;
}
.child {
position: absolute;
writing-mode: vertical-rl;
right: 30px;
top: 0px;
}
-
writing-mode쓰면 parent 안에서 위치하기 때문에 위치 조정 쉬움
https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode
'Frontend' 카테고리의 다른 글
순수 JS로 모듈 컴포넌트 만들기 (0) | 2023.06.12 |
---|---|
Redux test를 위한 export, default export 구분 (0) | 2020.11.08 |
Grid template minmax, auto-fill, auto-fit (0) | 2020.03.23 |