开发者

I am seeking help for CSS trick

I have a little CSS code as below:

input{
    background-image:url(css_img/input_bg.gif);
    padding:6px;
    margin:1px;
    width:250px;
    font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
    font-size:12px;
    font-weight:bold;
    font-variant:normal;
    height:30px;
    -moz-border-radius:3px 3px 3px 3px;
    -moz-box-shadow:0 2px 3px #DDDDDD;
    border:1px solid #aaa;
    color:#333333;
}

But this code changes the style of all the <input type="..."/> tags. How can I change the style of just text 开发者_如何学Cfields <input type="text" name="name" />? I don't want to have to add classes to them.

Also is there any way to round the corner just using plain CSS (not using image) which diplays well in Internet Explorer.

Please help me...


Use an attribute selector:

input[type="text"] {
    /* styles here */
}


Use an attribute selector:

input[type="text"] { styles here }


As Eric and Rikudo stated :

input[type="text"]

For the corners in ie use CSS3 PIE

You can also use :

input[type=text]
input[type^=te]
input[type$=ex]
input[type*=t]

Element input with attribute type which contains a value that is equal to, begins with, ends with or contains a certain value.

More info here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜