모든 CSS 요소를 리사이즈 가능하게 만드는 방법 🔧 (JavaScript 없이)

발행: (2026년 1월 2일 오전 03:43 GMT+9)
2 min read
원문: Dev.to

Source: Dev.to

The resize property

기본적으로 요소는 크기를 조절할 수 없습니다.
요소를 크기 조절 가능하게 만들고 싶다면(예: <textarea>처럼) CSS resize 속성을 사용할 수 있습니다:

/* Make the element resizable in both directions */
resize: both;

/* The element must also have an overflow value that allows scrolling */
overflow: auto; /* or overflow: scroll; */

두 번째 줄이 핵심입니다—resizeoverflow를 스크롤이 가능한 값(auto 또는 scroll 등)으로 설정하지 않으면 작동하지 않습니다.

The three values of resize

/* Allow resizing both horizontally and vertically */
resize: both;

/* Allow only horizontal resizing */
resize: horizontal;

/* Allow only vertical resizing */
resize: vertical;

resize: both;를 사용하면 사용자는 요소의 오른쪽 아래 모서리를 잡아 끌어 크기를 조절할 수 있습니다. 유일한 제한은 크기 조절이 측면이 아니라 모서리에서만 가능하다는 점입니다. 이 동작은 많은 사용 사례에 충분히 적합할 수 있습니다.

Back to Blog

관련 글

더 보기 »

모던 웹 개발 시작하기

![Forem 로고](https://media2.dev.to/dynamic/image/width=65,height=,fit=scale-down,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2...)

내 포트폴리오

개요: 나는 2025년 말에 개인 포트폴리오를 완성했고, 이 이정표를 Dev.to에 공유하고 싶었다. 나는 시스템 분석 및 개발 전공 학생이다.