4

在 Google Chrome 中,我有一个 select 标记,其中包含在浏览器中查看时以小写首字母呈现的国家/地区。在所有其他浏览器中,它们都有大写字母。选项标签以小写首字母呈现,但我们有样式将它们大写。难道是谷歌浏览器不知道如何应用这种风格?我在 iFrame 中的选择的 Chromium 问题列表中看到了问题;但是,此选择标记不在 iFrame 中。

从 Mozilla 查看时的 CSS:

.web_form div.form_field select {
  text-transform:capitalize;
}

从谷歌浏览器查看时的 CSS:

.web_form div.form_field input[type="text"], .web_form div.form_field input[type="password"], .web_form div.form_field select {
  float: right;
  width: 200px;
  border: solid 1px #7B9EBD;
  text-transform: capitalize;
}

HTML(来自任何浏览器):

<select id="fld_country" name="fld_country" class="form_field">
    <option value="">Please Choose</option>
    <option value="233" title="US" selected="selected">united states</option>
    <option value="1" title="AF">afghanistan</option>

....... 继续

4

2 回答 2

3

这似乎是 Google Chrome 中的一个突出错误。您最好使用 javascript 或服务器端解析字符串。

http://groups.google.com/a/chromium.org/group/chromium-bugs/browse_thread/thread/b54006f7a2b5fe5b

http://code.google.com/p/chromium/issues/detail?id=31349

错误重现:http: //jsfiddle.net/wesbos/SgS85/

于 2011-08-22T18:13:19.330 回答
0

这看起来像是您要更改的选择器:

 .web_form div.form_field select 

尝试使其更具体(或更不具体)

像:

 .web_form div.form_field select option
于 2011-08-22T18:14:51.643 回答