如何更改此搜索栏的宽度?

发布于 2024-10-07 01:00:53 字数 544 浏览 0 评论 0原文

它在样式表上已经有一个前缀宽度,但我有两个不同的搜索栏,所以我无法修改那个搜索栏,有没有一种方法可以覆盖该宽度并将其更改为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

寄人书 2024-10-14 01:00:53

正如您所看到的“搜索栏”的 id(实际上称为文本框)是 s

所以您只需放入 CSS 即可

#s
{
    width:200px;
}

在此处查看一个工作示例:

http://www.jsfiddle.net/hdm4Q/

As you see the id of your "search bar" which is actually called textbox is s

So you just have to put in you CSS

#s
{
    width:200px;
}

See a working example here:

http://www.jsfiddle.net/hdm4Q/

笔落惊风雨 2024-10-14 01:00:53

查看您的标记,您拥有与 div 关联的 id 和类。

为什么不在样式表中为 id 制定一条规则并将其放在 widget_search 类之后呢?

例如

#search-10 
{
    width:200px;
}

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

#search-10 
{
    width:200px;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文