我们经常会看到yahoo 网站他们的搜索输入框都非常的漂亮,它们是用什么来定义的呢,下面我们就看看css 定义input的样式吧,先来看一个效果图片.
这就是我测试时定义的input的样式哦,下面我们来看看我的定义代码吧.
<style>
.w{
width:160px;
height:19px;
border:1px solid #6699CC;
background-image:url(pic/ad3.jpg);
}
.b{
background-image:url(pic/2.jpg);
width:100px;
border:0px;
}
</style>
这是css代码,下面来看看html代码.
<divclass=news>
<form id="form1" name="form1" method="post" action="">
<label>
<input class="w" type="text" name="textfield" id="textfield" />
</label>
<label>
<input type="submit"class="b" name="button" id="button" value=" " />
</label>
</form>
</div>
注意提示一点的就是在定义type=submit时必须设置border=0才会生效哦.
好了本站原创转载请注明www.111cn.net/cssdiv/css.html