Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.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嵌入CSS_Jquery_Css - Fatal编程技术网

用jquery嵌入CSS

用jquery嵌入CSS,jquery,css,Jquery,Css,我正在尝试使用jquery将css嵌入到HTML主体中。css看起来像 .a .a101{fill:rgb(165,0,38)} .a .a102{fill:rgb(215,48,39)} 我尝试了以下方法,但未被识别: $(".a .a101").css({ fill : 'rgb(165,0,38)' }); $(".a .a102").css({ fill : 'rgb(215,48,39)' }); 你能告诉我正确的方法吗 -关于试试.css({background:

我正在尝试使用jquery将css嵌入到HTML主体中。css看起来像

.a .a101{fill:rgb(165,0,38)}
.a .a102{fill:rgb(215,48,39)}
我尝试了以下方法,但未被识别:

$(".a .a101").css({
    fill : 'rgb(165,0,38)'
});
$(".a .a102").css({
    fill : 'rgb(215,48,39)'
});
你能告诉我正确的方法吗

-关于

试试
.css({background:rgb(165,0,38})
,afaik css没有“fill”属性

编辑: 如果您想用某种颜色填充容器,可以尝试:

div{
    position:relative;
}
div.fill:before{
    background:#f00;
    content:"";
    left:0;
    height:100%;
    top:0;
    width:100%;
    z-index:2;
}
然后

试试
.css({background:rgb(165,0,38})
,afaikcss没有“fill”属性

编辑: 如果您想用某种颜色填充容器,可以尝试:

div{
    position:relative;
}
div.fill:before{
    background:#f00;
    content:"";
    left:0;
    height:100%;
    top:0;
    width:100%;
    z-index:2;
}
然后

试试
.css({background:rgb(165,0,38})
,afaikcss没有“fill”属性

编辑: 如果您想用某种颜色填充容器,可以尝试:

div{
    position:relative;
}
div.fill:before{
    background:#f00;
    content:"";
    left:0;
    height:100%;
    top:0;
    width:100%;
    z-index:2;
}
然后

试试
.css({background:rgb(165,0,38})
,afaikcss没有“fill”属性

编辑: 如果您想用某种颜色填充容器,可以尝试:

div{
    position:relative;
}
div.fill:before{
    background:#f00;
    content:"";
    left:0;
    height:100%;
    top:0;
    width:100%;
    z-index:2;
}
然后


首先,我认为你应该从仔细阅读开始

然后,它实际上非常简单,您只是忘记了引号:
.css({'fill':'red'})

仅供参考,您可以在vanilla JS中轻松完成:

document.queryselectoral('#idforthisesample').style.fill='silver';

编辑:
.你会有很好的表现,这是很好的训练。

首先,我认为你应该从仔细阅读开始

然后,它实际上非常简单,您只是忘记了引号:
.css({'fill':'red'})

仅供参考,您可以在vanilla JS中轻松完成:

document.queryselectoral('#idforthisesample').style.fill='silver';

编辑:
.你会有很好的表现,这是很好的训练。

首先,我认为你应该从仔细阅读开始

然后,它实际上非常简单,您只是忘记了引号:
.css({'fill':'red'})

仅供参考,您可以在vanilla JS中轻松完成:

document.queryselectoral('#idforthisesample').style.fill='silver';

编辑:
.你会有很好的表现,这是很好的训练。

首先,我认为你应该从仔细阅读开始

然后,它实际上非常简单,您只是忘记了引号:
.css({'fill':'red'})

仅供参考,您可以在vanilla JS中轻松完成:

document.queryselectoral('#idforthisesample').style.fill='silver';

编辑:
。您将获得良好的性能,这是一次很好的培训。

假设您希望使用fill属性(假设您使用的是SVG):

假设您要使用背景:

$(".a .a101").css({
    'background' : 'rgb(165,0,38)'
});

假设您想要使用fill属性(假设您使用的是SVG):

假设您要使用背景:

$(".a .a101").css({
    'background' : 'rgb(165,0,38)'
});

假设您想要使用fill属性(假设您使用的是SVG):

假设您要使用背景:

$(".a .a101").css({
    'background' : 'rgb(165,0,38)'
});

假设您想要使用fill属性(假设您使用的是SVG):

假设您要使用背景:

$(".a .a101").css({
    'background' : 'rgb(165,0,38)'
});

HTML正文是指
标记吗?我们能看到HTML吗?上下文总是有用的。HTML正文是指
标记吗?我们能看到HTML吗?上下文总是有用的。HTML正文是指
标记吗?我们能看到HTML吗?上下文总是有用的。HTML正文是指
标记吗?我们能看到H吗TML?上下文总是有用的。@Fabio true,但这看起来不像SVG在这里发挥作用。@Fabio true,但这看起来不像SVG在这里发挥作用。@Fabio true,但这看起来不像SVG在这里发挥作用。@Fabio true,但这看起来不像SVG在这里发挥作用。