问题与< select>和:之后在WebKit中的CSS [英] problem with <select> and :after with CSS in WebKit

查看:93
本文介绍了问题与< select>和:之后在WebKit中的CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在一个选择框中添加一些样式:pseudo(后面的样式,我的选择框有2部分,没有图像)。这里是HTML:

I would like to add some style on a select box with the pseudo :after (to style my select box with 2 parts and without images). Here's the HTML:

<select name="">
  <option value="">Test</option>
</select>

它不工作。我不知道为什么,我没有找到答案在W3C规范。这里是CSS:

And it doesn't work. I don't know why and I didn't find the answer in the W3C specs. Here's the CSS:

select {
  -webkit-appearance: none;
  background: black;
  border: none;
  border-radius: 0;
  color: white;
}

select:after {
  content: " ";
  display: inline-block;
  width: 24px; height: 24px;
  background: blue;
}

那么是正常还是有窍门?

So is it normal or is there a trick?

推荐答案

我没有检查过这个广泛,但我的印象是,这不是(但?)可能, select 元素是由浏览器运行的操作系统生成的,而不是浏览器本身。

I haven't checked this extensively, but I'm under the impression that this isn't (yet?) possible, due to the way in which select elements are generated by the OS on which the browser runs, rather than the browser itself.

这篇关于问题与&lt; select&gt;和:之后在WebKit中的CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆