While styling the jQuery autocomplete plugin, I get the following HTML code hardwired to my page:
<ul class="ui-autocomplete ui-menu ui-widget ui-widget-content ui-corner-all" role="listbox" aria-activedescendant="ui-active-menuitem" style="z-index: 1; top: 0px; left: 0px; display: none; "></ul>
How can I disable styling from being made through HTML and keep it done via CSS? I don’t think my CSS files are overwriting that style.
Any help will do
jQuery autocomplete needs to set some inline styles to position the drop down list under the text box and size it equally.
It doesn’t set anything else, so it’s completely up to you to provide visual styling of it by setting styles of those classes that are added to it (ie.
ui-autocomplete).Advice
What I’m trying to tell you is this: set the visual aspects of the drop down list that gets displayed and don’t worry about positioning and sizing inline styles.
Need to change positioning
If you do need to override positioning and sizing of this element you can always set your styles as
!important.Additional edit
Setting
margin-topdoesn’t do anything since it calculates position every single time it displays the drop down. But you can try setting this:This actually does the trick.