如何写css让其只对input中的text生效
现在写了这样一段css,但是它将radio,checkbox也变了,加上了一个特别难看的框
INPUT
{
font-size:
10pt;
color:
black;
background-color:
white;
border-right:
gray 1px solid;
border-top:
gray 1px solid;
border-left:
gray 1px solid;
border-bottom:
gray 1px solid;
}
如果要为text重新定义一种样式,则修改的工作量就太大了
有没有类似a,
a:hover这样的css选择器?
可以用HTC实现..
demo.htm
<style>
INPUT
{
behavior:url(bao.htc);
}
.baoText
{
font-size:
10pt;
color:
black;
background-color:
white;
border-right:
gray 1px solid;
border-top:
gray 1px solid;
border-left:
gray 1px solid;
border-bottom:
gray 1px solid;
}
</style>
<input
type=text>
<input
type=checkbox>
bao.htc
<PUBLIC:COMPONENT
URN="urn:msdn-microsoft-com:workshop" >
<script>
if(element.type=="text")
{
this.className="baoText";
}
</script>
</PUBLIC:COMPONENT>