<!DOCTYPE html>
<
head
>
<
meta
charset
=
"utf-8"
/>
<
style
type
=
"text/css"
>
body{margin:0;padding:0;}
.div_content{
background: url("1.gif") no-repeat;
/*给input框添加背景图片,以凸显其透明效果。*/
width: 200px;
height: 200px;
}
.div_content>input{
outline: none;
border: none;
background-color: transparent;
/*必须将背景色设为透明,否则无效。(除非对于要设置的元素本身已经是透明的,如:span元素等)*/
background-color: rgba(0,0,0,0.25);
filter: progid:DXImageTransform.Microsoft.Gradient(startColorstr=#40000000,endColorstr=#40000000);
}
</
style
>
</
head
>
<
body
>
<
div
class
=
"div_content"
>
<
input
type
=
"text"
size
=
"20"
/>
</
div
>
</
body
>
</
html
>