1

我有TextBox一个 Ajax Control Toolkit AutoCompleteExtender,我在格式方面遇到了一些问题。

如果我省略CompletionListCssClass, CompletionListItemCssClass,CompletionListHighlightedItemCssClass值,则显示正常。但我只需要将自动完成文本向左对齐,并且TextBox.

如果我在 site.css 中设置这些值:

.autocomplete_listItem
{
    background-color: #222;
    color: #cfdbe6;
}

.autocomplete_highlightedListItem
{
    background-color: #999;
    color: #111;
}

.autocomplete_completionListElement
{

}

然后我的子弹就行了。

如何使项目符号不显示,将列表对齐在 下方TextBox,列表项左对齐,以及与 匹配的大小TextBox

4

1 回答 1

3

All you need to do to remove the bullets is add list-style-type:none to each of your classes:

.autocomplete_listItem
{
    background-color: #222;
    color: #cfdbe6;
    list-style-type:none;
}

.autocomplete_highlightedListItem
{
    background-color: #999;
    color: #111;
    list-style-type:none;
}

.autocomplete_completionListElement
{
    list-style-type:none;
}

This is because the autocomplete results are returned as a bulleted list by the AJAX extender - so if you customize the style, you need to make sure and hide those bullets.

In order to tell you how to align it properly with other elements, I would need to see your markup (which is not included in your question).

于 2012-06-08T13:19:12.293 回答