开发者

How to override default style on an input textbox

开发者 https://www.devze.com 2023-01-12 16:53 出处:网络
I have a default style like this: input[type=\"text\"] { width: 250px; } Now I have a input box that I want to have 450 width, how can I do this?

I have a default style like this:

input[type="text"] 
{ width: 250px; }

Now I have a input box that I want to have 450 width, how can I do this?

I've tried:

#searchbox 
{

width: 450px;
}


<input typ开发者_C百科e="text" value="" name="asb" id="searchbox">

but that didn't work.


Just make sure your rule is more specific than the default like so:

input[type="text"]#searchbox {
    width: 450px;
}
0

精彩评论

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