Home >Web Front-end >HTML Tutorial >I have a question_html/css_WEB-ITnose

I have a question_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:42:431039browse

$(".pe_xgtxB_r span").css("style","background:url(" json.path '190x190' json.localName ") no-repeat");
Why can't I give this SPAN? I imported this picture with json.path '190x190' json.localName spelled out to be the location of my picture


Reply to the discussion (solution)

Well
Please define the splicing path separately

var newUrl= json.path+'190x190'+json.localName;alert(newUrl);$(".pe_xgtxB_r span").css("background-image", newUrl);

$(".pe_xgtxB_r span").attr("style","background:url(" json.path '190x190' json.localName ") no-repeat");
or
$(".pe_xgtxB_r span").css({"background-image":"url(" json.path '190x190' json.localName ")","background -repeat":"no-repeat"});

It works well on both the 1st and 2nd floors

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn