Chrome select andamp;中的HTML select下拉列表中的选项值样式无效.苹果浏览器 [英] Styling for option values in a HTML select drop-down doesn't work in Chrome & Safari

查看:156
本文介绍了Chrome select andamp;中的HTML select下拉列表中的选项值样式无效.苹果浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

html下拉列表中选项值的内联CSS样式在Chrome和Safari上不起作用,但在Firefox和IE中似乎起作用.

The inline CSS styling for an option value in a html drop-down list does not work on Chrome and Safari, but does seem to work in Firefox and IE.

HTML代码的片段:

Snippet of the HTML code:

<option style="color:#4f5652;background:#f0f0ef;hite-space:nowrap;-webkit-appearance:button;text-overflow:ellipsis; padding:5px 4px 3px 4px;border-bottom:1px solid green" value="project">Project</option>

推荐答案

color样式在使用当前版本的Chrome,Safari,Firefox,IE和Opera以及Windows 7的Windows 7上的<option>元素中都可以正常工作Mac和Firefox;但在装有Chrome和Safari的Mac上似乎无法操作.对我来说似乎是个虫子.

color style works fine in <option> elements on Windows 7 with current versions of Chrome, Safari, Firefox, IE, and Opera, as well as on Mac with Firefox; but appears to be a no-op on Mac with Chrome and Safari. Seems like a bug to me.

这篇关于Chrome select andamp;中的HTML select下拉列表中的选项值样式无效.苹果浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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