• 코드:
​x
 
1
<!DOCTYPE html>
2
<html lang="ko">
3
​
4
<head>
5
    <meta charset="UTF-8">
6
    <title>CSS Forms</title>
7
    <style>
8
        input {
9
            width: 100%;
10
            padding: 10px 40px;
11
            margin: 5px 0;
12
            box-sizing: border-box;
13
            border: solid 2px #483D8B;
14
            border-radius: 5px;
15
            font-size: 14px;
16
            background-image: url("/examples/images/img_search_icon.png");
17
            background-position: 5px 4px;
18
            background-repeat: no-repeat;
19
        }
20
    </style>
21
</head>
22
​
23
<body>
24
​
25
    <h1>input 요소에 아이콘이나 이미지 삽입</h1>
26
    <form>
27
        검색할 키워드를 입력하세요 : <br>
28
        <input type="text" name="search"><br>
29
    </form>
30
​
31
</body>
32
​
33
</html>