如何更改此搜索栏的宽度?
它在样式表上已经有一个前缀宽度,但我有两个不同的搜索栏,所以我无法修改那个搜索栏,有没有一种方法可以覆盖该宽度并将其更改为 200px?谢谢
<div id="search-10" class="widget_search">
<form role="search" method="get" id="searchform" action="http://chusmix.com/?s=" onsubmit="window.location = action + s.value + '+: Cordoba'; return false;">
<div>
<input class="ubicacion" type="text" value="" name="s2" id="s" style="margin-left:0px;">
<input type="submit" id="searchsubmit" value="Buscar">
</div>
</form>
</div>
It already has a prefixed width on the stylesheet but I have two different searchbars so I cannot modify that one, is there a way to override that width and change it to 200px? THanks
<div id="search-10" class="widget_search">
<form role="search" method="get" id="searchform" action="http://chusmix.com/?s=" onsubmit="window.location = action + s.value + '+: Cordoba'; return false;">
<div>
<input class="ubicacion" type="text" value="" name="s2" id="s" style="margin-left:0px;">
<input type="submit" id="searchsubmit" value="Buscar">
</div>
</form>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如您所看到的“搜索栏”的
id
(实际上称为文本框)是s
所以您只需放入 CSS 即可
在此处查看一个工作示例:
http://www.jsfiddle.net/hdm4Q/
As you see the
id
of your "search bar" which is actually called textbox iss
So you just have to put in you CSS
See a working example here:
http://www.jsfiddle.net/hdm4Q/
查看您的标记,您拥有与 div 关联的 id 和类。
为什么不在样式表中为 id 制定一条规则并将其放在 widget_search 类之后呢?
例如
Looking at your markup you have both the id and the class associated with the div.
Why don't you just make a rule in your stylesheets for the id and place it after the widget_search class?
e.g