您如何设计 Google Places Autocomplete API 上的下拉菜单? [英] How do you style the dropdown on Google Places Autocomplete API?
问题描述
在使用 Google Places/Maps Autocomplete API 时,我们需要调整显示自动完成地点建议的下拉菜单的样式.
We need to tweak the styling of the dropdown that shows the autocomplete place suggestions when using the Google Places/Maps Autocomplete API.
有谁知道这是否可能?如果是这样,我想我们只需要知道 CSS 类名/ID.
Does anyone know if this is even possible? If so, I guess we just need to know the CSS classnames/IDs.
这里有一个我所指的屏幕截图:
There's a screen grab of the bit I am referring to here:
推荐答案
如果您使用 firebug(如对您的问题的评论中所述...),您会看到带有自动完成结果的容器是一个带有类"的 DIVpac-container",并且建议在其中作为带有pac-item"类的 DIV.所以只需使用 CSS 设置样式即可.
If you use firebug (as mentioned in a comment to your question...) you see that the container with the autocomplete results is a DIV with the class "pac-container" and the suggestions are inside it as a DIV with the class "pac-item". so just style with CSS.
这篇关于您如何设计 Google Places Autocomplete API 上的下拉菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!