3. 画像を設定するサンプル 入力フォームとテキストエリアに背景画像を設定するサンプルです。 HTML <p>サンプル1: <input type="text" class="demo3_1"></p> <p>サンプル2: <textarea class="demo3_2"></textarea></p> CSS .demo3_1 { width: 200px; height: 20px; background: url(search.png) no-repeat 2px center; padding-left: 20px; } .demo3_2 { width: 250px; height: 180px; background: url(line.png) repeat top center; line-height: 30px; } Result 4. テキストを初期表示させるサンプ