---
title: user-select
slug: Web/CSS/user-select
tags:
  - CSS
  - CSS Property
  - Reference
  - 'recipe:css-property'
translation_of: Web/CSS/user-select
---
<div>{{CSSRef}}</div>

<p><a href="/ko/docs/Web/CSS">CSS</a> <code><strong>user-select</strong></code> 속성은 사용자가 텍스트를 선택할 수 있는지 지정합니다.</p>

<pre class="brush:css notranslate">/* 키워드 값 */
user-select: none;
user-select: auto;
user-select: text;
user-select: contain;
user-select: all;

/* 전역 값 */
user-select: inherit;
user-select: initial;
user-select: unset;
</pre>

<h2 id="구문">구문</h2>

<dl>
 <dt><code>none</code></dt>
 <dd>이 요소와 아래 요소의 텍스트를 선택하지 못하도록 막습니다. 단 {{domxref("Selection")}} 객체는 <code>none</code>인 요소(와 그 아래)를 포함할 수 있습니다.</dd>
 <dt><code>auto</code></dt>
 <dd>
 <p><code>auto</code>의 사용값은 아래와 같이 결정됩니다.</p>

 <ul>
  <li><code>::before</code>와 <code>::after</code> 의사 요소의 사용값은 <code>none</code>입니다.</li>
  <li>편집 가능한 요소의 사용값은 <code>contain</code>입니다.</li>
  <li>그렇지 않고, 부모 요소 <code>user-select</code>의 사용값이 <code>all</code>이면 이 요소의 사용값도 <code>all</code>입니다.</li>
  <li>그렇지 않고, 부모 요소 <code>user-select</code>의 사용값이 <code>none</code>이면 이 요소의 사용값도 <code>none</code>입니다.</li>
  <li>그렇지 않으면 사용값은 <code>text</code>입니다.</li>
 </ul>
 </dd>
 <dt><code>text</code></dt>
 <dd>사용자가 텍스트를 선택할 수 있습니다.</dd>
 <dt><code>all</code></dt>
 <dd>요소의 콘텐츠가 원자적으로 선택됩니다. 즉 선택 범위는 이 요소와 그 아래의 자손 전체를 포함해야 하며 일부만 담을 수는 없습니다. 하위 요소에서 더블 클릭이나 콘텍스트 클릭이 발생한 경우, <code>all</code>을 지정한 조상 요소 중 제일 상위 요소를 선택합니다.</dd>
 <dt><code>contain</code></dt>
 <dd>선택의 시작을 이 요소 안에서 한 경우, 범위가 요소 바깥으로 벗어날 수 없습니다.</dd>
</dl>

<h2 id="형식_정의">형식 정의</h2>

<p>{{CSSInfo}}</p>

<h2 id="형식_구문">형식 구문</h2>

{{csssyntax}}

<h2 id="예제">예제</h2>

<h3 id="HTML">HTML</h3>

<pre class="brush: html notranslate">&lt;p&gt;You should be able to select this text.&lt;/p&gt;
&lt;p class="unselectable"&gt;Hey, you can't select this text!&lt;/p&gt;
&lt;p class="all"&gt;Clicking once will select all of this text.&lt;/p&gt;
</pre>

<h3 id="CSS">CSS</h3>

<pre class="brush: css notranslate">.unselectable {
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.all {
  -moz-user-select: all;
  -webkit-user-select: all;
  -ms-user-select: all;
  user-select: all;
}
</pre>

<h3 id="결과">결과</h3>

<p>{{EmbedLiveSample("예제")}}</p>

<h2 id="명세">명세</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS4 UI', '#propdef-user-select', 'user-select')}}</td>
   <td>{{Spec2('CSS4 UI')}}</td>
   <td>Initial definition. Also defines <code>-webkit-user-select</code> as a deprecated alias of <code>user-select</code>.</td>
  </tr>
 </tbody>
</table>

<h2 id="브라우저_호환성">브라우저 호환성</h2>

<div>


<p>{{Compat("css.properties.user-select")}}</p>
</div>

<h2 id="같이_보기">같이 보기</h2>

<ul>
 <li>{{Cssxref("::selection")}} 의사 요소</li>
 <li>JavaScript {{domxref("Selection")}} 객체.</li>
</ul>