.parent {
position: relative;
}
.child {
position: absolute;
right: 0;
}
right: 0
만으로는 원하는 정렬이 안되는 이유position: relative
필요.container {
display: flex;
justify-content: flex-end;
}
text-align: right
: 인라인 요소 정렬margin-left: auto
: 블록 요소 오른쪽 정렬장점:
단점:
장점:
단점:
상황에 따라 적절한 방법을 선택하는 것이 중요합니다.
특히 React Native에서는 Flexbox를 기본으로 사용하므로, Flexbox를 활용한 레이아웃 구성에 익숙해지는 것이 좋습니다.