input css - 网站前台 - 电子商务 elink8.com
发新话题
打印

input css

input css

使用css可以很好的进行格式的设计,有的时候,甚至可以直接定义html的标签的格式,但对于input,这个标签,比较复杂。
可能type=select  | type=button ||type=text等等几种情况。不好定义。于是就用上面的办法,对他进行定义。
如果是select还可以
<input type="select" css=".mystyle">
如果是<asp:button >还可以
<asp:button cssClass=".mystyle">
我想定义文本框(<input type=text>)的样式,定义如下:
input {BORDER: 1px #333333 solid;}
但是这样定义之后,连checkbox,button的样式也被定义了,
有什么办法只定义text的样式呢?前提是不使用class
<style>
input{border-color:expression((this.type=="text")?"#333333":"")}
input{border-style:expression((this.type=="text")?"solid":"")}
input{border-width:expression((this.type=="text")?"1px":"")}
</style>
<input type="text">
<input type="button">
<input type="checkbox">

expression目前只有IE支持~

TOP

发新话题