Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在css中提供适当的边距_Css_Autocomplete_Textbox - Fatal编程技术网

如何在css中提供适当的边距

如何在css中提供适当的边距,css,autocomplete,textbox,Css,Autocomplete,Textbox,这是我的文本框,我在其中填充了数据库中的城市名称,并实现了自动完成功能。现在,您可以看到自动完成框的左侧出现了一个恒定的间隙。如何从cs中删除该间隙。请帮助 <asp:AutoCompleteExtender ID="autoComplete1" runat="server" EnableCaching="true" BehaviorID="AutoCompleteEx" MinimumPrefixLength="2" TargetControlID="myText

这是我的文本框,我在其中填充了数据库中的城市名称,并实现了自动完成功能。现在,您可以看到自动完成框的左侧出现了一个恒定的间隙。如何从cs中删除该间隙。请帮助

<asp:AutoCompleteExtender ID="autoComplete1" runat="server"    
 EnableCaching="true"
  BehaviorID="AutoCompleteEx"
   MinimumPrefixLength="2"
  TargetControlID="myTextBox"
   ServicePath="AutoComplete.asmx"
  ServiceMethod="GetCompletionList" 
   CompletionInterval="1000"  
   CompletionSetCount="20"
    CompletionListCssClass="autocomplete_completionListElement"
  CompletionListItemCssClass="autocomplete_listItem"
  CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
  DelimiterCharacters=";, :"
  ShowOnlyCurrentWordInCompletionListItem="true">
  <Animations>
  <OnShow>
  <Sequence>
   <%-- Make the completion list transparent and then show it --%>
  <OpacityAction Opacity="2" />
   <HideAction Visible="true" />

     <%--Cache the original size of the completion list the first time
     the animation is played and then set it to zero --%>
      <ScriptAction Script="// Cache the size and setup the initial size
                            var behavior = $find('AutoCompleteEx');
                            if (!behavior._height) {
                                var target = behavior.get_completionList();
                                behavior._height = target.offsetHeight - 2;
                                target.style.height = '0px';
                            }" />
            <%-- Expand from 0px to the appropriate size while fading in --%>
           <Parallel Duration=".4">
             <FadeIn />
        <Length PropertyKey="height" StartValue="0" 
EndValueScript="$find('AutoCompleteEx')._height" />
           </Parallel>
         </Sequence>
          <OnHide>
      <%-- Collapse down to 0px and fade out --%>
              <Parallel Duration=".4">
        <FadeOut />
        <Length PropertyKey="height" StartValueScript=
"$find('AutoCompleteEx')._height" EndValue="0" />
         </Parallel>
     </OnHide>
           </Animations>

可能是css中的空白问题
请添加
空白:nowrap并检查其是否工作

添加

margin : 0px!important;

使用它时,您需要在现有样式表下方的页面中添加样式

CSS


请发一些code@AshkanMobayenKhiabani:哪个代码???..css或asp?html或脚本使此自动完成您正在使用“列表样式类型”假设您正在使用列表构建下拉列表,是否正确?如果是,则增加保证金:0;你的UL应该解决这个问题吗?@AshkanMobayenKhiabani:我已经更改了代码plss请显示你用于自动完成的代码的css。我正在编辑我的答案试试这个,看看那个问题
.autocomplete_completionListElement,
.autocomplete_completionListElement > li {
    margin:0;
}