我发现了这个主题:将CSS应用于搜索的历史记录下拉
如果我正确理解了其评论(不是程序员,而只是一个小时代码调整器):使用CSS更改几乎是不可能的已经存在的下拉列表,该列表显示了输入框的先前搜索表达式?
我试图从1990年代重新设计网站,并且只能与CSS一起使用,而不是触摸HTML文件。原始代码是这样:
<form method="Post" action="/cgi-bin/-NAME-OF-THE-SITE-/the_search_form">
<hr>
<label for="search">Type text you would like to search for here: </label>
<input name="tquery" id="search" size="25" maxlength="60"> <p>
</p><center>
<input type="Submit" value="FIND"> <input type="Reset" value="CLEAR">
</center>
<hr>
</form>
我设法在视觉上返回提交
和 reset
按钮以及输入框本身 - 但是下拉列表在该框下方显示自身[我侦察]给定浏览器的默认视觉效果(因为它在Firefox中看起来与Opera不同],
我也想增加 Maxlengt
参数[即输入允许的符号数],但是我所能做的就是相反 - 限制它[以下(比原始 60
值]
I found this topic: Apply CSS to searched history drop down
If I understood its comments correctly [not being a programmer but just a small time code tweaker]: it is pretty much impossible to change with CSS an already existing drop down list that shows previous search expressions of an input box?
I am trying to rework a site from 1990s and can only work with CSS on it, not touching the HTML files. The original code is this:
<form method="Post" action="/cgi-bin/-NAME-OF-THE-SITE-/the_search_form">
<hr>
<label for="search">Type text you would like to search for here: </label>
<input name="tquery" id="search" size="25" maxlength="60"> <p>
</p><center>
<input type="Submit" value="FIND"> <input type="Reset" value="CLEAR">
</center>
<hr>
</form>
I have managed to rework visually the Submit
and Reset
buttons and also the input box itself - but the drop down list showing itself below that box has [I recon] the default visuals of a given browser [as it looks are different in Firefox than in Opera]
I would also like to increase the maxlengt
parameter [i.e. the number of signs allowed for input], but all I could do was the opposite - limiting it [below than original 60
value]
发布评论
评论(1)
当前,无法定型自动完成下拉菜单。
浏览器插入自动完成的下拉列表,无法设计。但是,人们已经找到了在其中创建自己的自定义下拉列表的方法,但这需要大量的JS和其他HTML元素。这是一个自定义自动完整搜索栏的示例:
因此,在您的特殊情况下,请不要担心!如果浏览器样式的自动完成方式不同,那么您就牢记了对用户的更好,因为它与他们习惯的相一致。另一种选择是完全关闭自动完成。
但是再次,您说您只能触摸样式!
Currently, it is impossible to style autocomplete dropdowns.
The autocomplete dropdowns are inserted in by the browser and can not be styled. However, people have found ways around it be creating there own custom dropdowns but this requires a lot of JS and a few more HTML elements. Here is a example here of a custom autocomplete search bar: https://www.w3schools.com/howto/howto_js_autocomplete.asp
So in your particular case just don't worry about it! If the browser styles the autocomplete differently then you had in mind it will be better for the users because it's consistent with what they are used to. One more option is to just turn off autocomplete entirely like this.
But again, you said you can only touch the styles!