Firefox ignores option selected=“selected”

前端 未结 20 1627
你的背包
你的背包 2020-11-28 21:59

If you change a dropdown and refresh the page, Firefox seems to ignore the selected attribute.

20条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-28 22:42

    At work, I just fixed a bug where the select box option displayed properly in Chrome but not in Firefox, on the same web page. It turned out to be something completely different than the problems above, but could possibly be a problem you are experiencing.

    In Chrome, the select box font-color was black. For some reason in Firefox, the select box inherited the font-color from the container, which was white. Once I added a CSS rule to force that select box font-color to be black, the value set was properly displayed.

提交回复
热议问题