> 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/html-css/form-and-input.md).

# form & input

```html
<div class="form-background">
    <div class="form-white">
        <form>
            <h3>Contact Us</h3>
            <p>Your Email</p>
            <div class="w-100">
                <input class="form-input" placeholder="mail@example.com">
            </div>
            <div class="w-50">
                <p>First Name</p>
                <input class="form-input">
            </div>
            <div class="w-50">
                <p>Last Name Name</p>
                <input class="form-input">
            </div>
            <div class="w-100">
                <p>Message</p>
                <textarea class="form-input form-long"></textarea>
            </div>

            <div style="vertical-align: middle">
                <input id="sub" type="checkbox">
                <label for="sub">Subscribe</label>
                <button class="submit-button">SEND</button>
            </div>
        </form>
    </div>
</div>
```

```css

.form-background {
    background-color: black;
    padding: 30px;
}

.form-white {
    background-color: white;
    padding: 30px;
    width: 80%;
    max-width: 600px;
    margin: auto;
}

.w-50 {
    width: 50%;
    float: left;
    padding: 10px;
}

.w-100 {
    width: 100%;
    padding: 10px;
}

.form-input{
    width: 100%;
    padding: 10px;
    font-size: 20px;
    border: 1px solid black;
    border-radius: 5px;
}

.form-long {
    height: 200px;
}

.submit-button {
    width: 120px;
    border: none;
    background-color: #FFC300;
    padding: 10px;
    display: block;
    margin-left: auto;
    border-radius: 10px;
    color: #eee;
    font-size: 20px;

}
div, input , textarea {
    box-sizing: border-box;
}



```

**전송버튼 만들기**&#x20;

```html
<form>
  <button type="submit">전송</button>
  <input type="submit">
</form>
```

**label 태그와 for 속성**

```html
<input type="checkbox" id="subscribe">
<label for="subscribe">누르기</label>
```

label과 for 속성을 적절히 활용하면

input대신 label을 눌러도 input을 선택할 수 있습니다.

input의 id, label의 for 속성을 똑같이 맞춰주면 됩니다

혹은 그냥  에 제목이 필요할 때도 h, p 태그 이런거 말고 태그를 가끔 이용합니다.
