Jquery css代码在浏览器中不起作用

Van*_*ana 0 html css jquery

这是我在一个td申请的css.但这不适用于IE,FF和其他浏览器.

 $("#tdTopMenu").css({ "backgroundColor": "003f60", "height": "17pt", "display": "block", "white-space": "nowrap", "min-width": "1250px" });
Run Code Online (Sandbox Code Playgroud)

如果我写一行

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
Run Code Online (Sandbox Code Playgroud)

然后它开始在IE中显示,而不是在其他浏览器中.请帮忙

Que*_*tin 5

003f60不是一种颜色.#003f60是.确保您尝试应用的CSS有效.

  • @mzohreh根据http://api.jquery.com/css/两种符号都是可行的,`backgroundColor`和`background-color`.唯一的区别是你不需要围绕backgroundColor引用. (2认同)
  • @mzohreh不仅是backgroundColor,还有`fontWeight,marginLeft,marginRight等其他风格,`有 (2认同)