更改mozilla中选择框下拉列表的颜色

时间:2017-02-28 05:52:08

标签: html css google-chrome

我创建了一个选择框背景颜色。在铬合金下拉列表中显示背景颜色但铬合金显示为白色。我想在mozilla下拉列表中应用背景颜色,如在chrome中

select{
background-color:red;
}
<select>
   <option>1</option>
   <option>2</option>
   <option>3</option>
</select>

相同的下拉列表在mozilla中显示为白色

1 个答案:

答案 0 :(得分:0)

之前已经回答过类似的问题。您需要将-moz-appearance设置为none。 Why does Firefox set a background color on the select arrow button when I set a custom border or background color?

    import UIKit
    import Social

    class ShareViewController: UIViewController,UITableViewDataSource {

      @IBOutlet var languageTable: UITableView!

      var languageList = ["Swift","Python","Java","ObjC",".Net","php"]


      override func viewDidLoad() {
        languageTable.dataSource = self
        languageTable.reloadData()
      }

      func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 1
      }

      func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return languageList.count
      }

     func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
       let cell:UITableViewCell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath)
       cell.textLabel?.text = languageList[indexPath.row]
       return cell
     }

    }
相关问题