# currentColor

#### [`currentColor`](https://developer.mozilla.org/ko/docs/Web/CSS/color_value#currentcolor_%ED%82%A4%EC%9B%8C%EB%93%9C) <a href="#currentcolor_" id="currentcolor_"></a>

`currentColor` 키워드는 요소의 [`color`](https://developer.mozilla.org/ko/docs/Web/CSS/color) 속성값을 나타낸다.&#x20;

부모로 부터 물려 받는 color 값일 수 있고 현재 요소의 color 값을 받아 올 수 있다.&#x20;

```markup
// 현재 요소의 color 값을 border 색상으로 지정
<div style="color: blue; border: 1px dashed currentColor;">
  이 글의 색은 파랑입니다.
  // 상위 요소의 color 값을 받아 옴 
  <div style="background: currentColor; height:9px;"></div>
  이 블록은 파란 테두리로 둘러쌓여 있습니다.
</div>
```

![](https://161134766-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MPKJK-Pogdi-NHl4GxU%2F-MSiR-sMC3_qSxPplCoF%2F-MSiRQcw-oRjGoFoRtEv%2Fimage.png?alt=media\&token=4c07ee9c-9172-4cdf-abce-fecebf822b19)

위 상황에서 내부 블럭에 color 값을 준다면 background는 해당 요소의 color 값으로 적용된다.&#x20;

```markup
<div style="color: blue; border: 1px dashed currentColor;">
  이 글의 색은 파랑입니다.
  // 요소에 color 값을 추가 함.
  <div style="background: currentColor; height:9px; color:red;"></div>
  이 블록은 파란 테두리로 둘러쌓여 있습니다.
</div>
```

![](https://161134766-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MPKJK-Pogdi-NHl4GxU%2F-MVtstT1dnqTjLhBRs5s%2F-MVtyX2B6oPaPywBzwew%2Fimage.png?alt=media\&token=bc0920e6-2368-4820-a1b0-3a8cf30ddf10)

{% embed url="<https://blog.adobe.com/en/publish/2015/02/24/extending-the-color-cascade-with-the-css-currentcolor-variable.html#gs.vqsp1p>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://shhn0509.gitbook.io/html-and-css/stylesheet/upgrade-css/untitled-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
