如何在select中居文本?

时间:2016-08-21 14:13:31

标签: html css select

我有这个例子。 我需要在选择和箭头中联合选定的文本并将其放在中心。 我怎样才能做到这一点?我希望任何选定的文本总是在箭头的中心。 也许我可以使用insted select?我需要这样的下拉菜单: http://prnt.sc/c8iorl 也许选择不是我需要的这种类型的菜单?

mydict = {'one': 1, 'two': 2, 'three': 3}
mykeys = ['three', 'one','ten']
newList=[mydict[k] for k in mykeys if k in mydict]
print newList
[3, 1]
.filter-col {
  display: inline-block;
  margin: 0 15px;
  border: 1px solid black;
}
.filter-col select {
  width: 100%;
  padding: 0 15px 0 0;
  border: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  text-indent: 0.01px;
  text-overflow: '';
  -ms-appearance: none;
  appearance: none!important;
  background-image: url(http://foodservice.freelancerblog.ru/images/i/sort-bottom-arrow.png);
  background-position: right center;
  background-repeat: no-repeat;
  color: #8d8d8d;
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  text-align: right;
}

0 个答案:

没有答案