> For the complete documentation index, see [llms.txt](https://leeans-dev-book.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://leeans-dev-book.gitbook.io/docs/lecture/javascript/ui.md).

# UI 만들기

✨과제. 색상을 빨간색 배경색을 검은색으로 변경해봅시다.

{% code overflow="wrap" %}

```javascript
  <script>
        document.getElementById('hello').style.color = "red";
        document.getElementById('hello').style.background = "rgb(0,0,0)";
        document.getElementById('hello').style.background = "#000000";
  </script>
```

{% endcode %}

✨실습. 폰트와 폰트사이즈 변경&#x20;

{% embed url="<https://htmlcolorcodes.com/>" %}
색  rgb와 hex 값 알려주는 사이트&#x20;
{% endembed %}

UI 만드는 스텝&#x20;

1. HTML / CSS 로 미리 디자인&#x20;
2. 필요할 때 호출

<figure><img src="/files/omaDDpCJKWQTuLo7VC2Z" alt=""><figcaption><p>js002.html 파일 생성</p></figcaption></figure>

{% code title="main.css" overflow="wrap" %}

```css
.alert-box {
    background-color: cornflowerblue;
    padding: 20px;
    color: white;
    border-radius: 5px;
    display: none;
}
/* css 파일생성  */
```

{% endcode %}

✨실습. 알림창 띄우는 스크립트 작성

✨실습. 알림창 닫기 버튼 만들고 닫기 기능 스크립트 작성

<figure><img src="/files/5pfkY8QGMvAzot3uwKhb" alt=""><figcaption><p>UI 컴포넌트 예시</p></figcaption></figure>

##

##

## 😒완성된 코드만 보고 따라치는건 아무 의미없다.

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="main.css">
</head>
<body>
    <div id="alert" class="alert-box" >
        알림창
        <button onclick="document.getElementById('alert').style.display = 'none'">닫기</button>
    </div>
    <button onclick="document.getElementById('alert').style.display = 'block'">알림창을 보여줘!</button>
</body>

</html>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://leeans-dev-book.gitbook.io/docs/lecture/javascript/ui.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
