本文共 960 字,大约阅读时间需要 3 分钟。
集成了jquery autocomplete,不知道为什么生成的下拉框是居中的,没有左对齐,习惯性还是左对齐好看一点,所以修改了一下jquery.autocomplete.css这个样式文件,要想左对齐其实很简单,加上下面这一行代码就行:
text-align: left;
在.ac_results li里面添加,添加后css文件代码如下:
.ac_results { padding: 0px; border: 1px solid black; background-color: white; overflow: hidden; z-index: 99999;}.ac_results ul { width: 100%; list-style-position: outside; list-style: none; padding: 0; margin: 0;}.ac_results li { margin: 0px; padding: 2px 5px; cursor: default; display: block; /* if width will be 100% horizontal scrollbar will apear when scroll mode will be used */ /*width: 100%;*/ font: menu; font-size: 12px; /*new add for left*/ text-align: left; /* it is very important, if line-height not setted or setted in relative units scroll will be broken in firefox */ line-height: 16px; overflow: hidden;}.ac_loading { background: white url('indicator.gif') right center no-repeat;}.ac_odd { background-color: #eee;}.ac_over { background-color: #0A246A; color: white;}
转载地址:http://ajxci.baihongyu.com/