Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 如何在ie8中动态添加样式_Jquery_Css_Internet Explorer 8 - Fatal编程技术网

Jquery 如何在ie8中动态添加样式

Jquery 如何在ie8中动态添加样式,jquery,css,internet-explorer-8,Jquery,Css,Internet Explorer 8,我使用下面的代码动态附加样式标记 $("<style id=highlightSegment type='text/css'> .highlightStyle{ fill:red;stroke:black;}</style>").appendTo("body"); $(“.highlightStyle{fill:red;stroke:black;}”).appendTo(“body”); 它在chrome、firefox和IE10中运行。。但它在IE8中不起作用 如何

我使用下面的代码动态附加样式标记

$("<style id=highlightSegment type='text/css'> .highlightStyle{ fill:red;stroke:black;}</style>").appendTo("body");
$(“.highlightStyle{fill:red;stroke:black;}”).appendTo(“body”);
它在chrome、firefox和IE10中运行。。但它在IE8中不起作用


如何解决以及如何在IE8中实现这一点

样式
元素应附加到
头部
@rorymcrossan ok,但这不是一个问题problem@RoryMcCrossan而且我换了头,而不是身体仍然不工作