1. 程式人生 > >帶圖示的input框

帶圖示的input框


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>帶圖示的input框</title>
<style
>
.text{border:solid 1px #ccc;width:400px;height:40px;background:url(http://url.png) no-repeat 0 center;} .text input{float:left;border:none;background:none;height:40px;line-height:30px;width:100%; text-indent:32px;} </style> </head> <body> <div class="text"> <input type="text"
/>
</div> </body>