相关疑难解决方法(0)

如何使用CSS设置<select>下拉列表的样式?

是否有一种仅限CSS的方式来设置<select>下拉列表的样式?

我需要<select>尽可能多地为一个表单设置样式,而不需要任何JavaScript.我可以在CSS中使用哪些属性?

此代码需要与所有主流浏览器兼容:

  • Internet Explorer 6,7和8
  • 火狐
  • 苹果浏览器

我知道我可以使用JavaScript:示例.

我不是在谈论简单的造型.我想知道,只有CSS才能做到最好.

我在Stack Overflow上发现了类似的问题.

这一次在Doctype.com.

html css combobox cross-browser skinning

1258
推荐指数
19
解决办法
155万
查看次数

如何针对某些情况(如Internet Explorer特定的CSS或特定于Internet Explorer的JavaScript代码)仅定位Internet Explorer 10?

如何针对某些情况(如Internet Explorer特定的CSS或特定于Internet Explorer的JavaScript代码)仅定位Internet Explorer 10?

我试过这个,但它不起作用:

<!--[if IE 10]>    <html class="no-js ie10" lang="en"> <![endif]-->
<!--[if !IE]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
Run Code Online (Sandbox Code Playgroud)

Internet Explorer 10忽略条件注释并使用<html lang="en" class="no-js">而不是<html class="no-js ie10" lang="en">.

html javascript css conditional-comments internet-explorer-10

159
推荐指数
10
解决办法
16万
查看次数

在Firefox 22中隐藏默认选择箭头

以下是这个答案/sf/answers/1239962741/

我尝试实现相同的解决方案,但它在我的Windows 7 Firefox 22上不起作用,这就是我得到的:

在此输入图像描述

select {
    -moz-appearance: window;
    -webkit-appearance: none;
    background: #f5f5f5 url("/images/arrow_down.png") right center no-repeat;
    padding-right: 20px;
}
@-moz-document url-prefix() {
.wrapper {
     background: #f5f5f5 url("/images/arrow_down.png") right center no-repeat;
     padding-right: 20px;
  }
}
Run Code Online (Sandbox Code Playgroud)

编辑:这是一个jsfiddle http://jsfiddle.net/TGBEZ/1/

css firefox

11
推荐指数
2
解决办法
1万
查看次数