I’m trying to not repeat background.
Here is my code
$("body").css({background : "url(../img/bgr.png)", backgroundRepeat: 'none'});
The problem is that the background repeats. How to fix that ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your problem is that
backgroundsets all background-related options whilebackground-repeatis just a single one – which is overridden bybackground.The best solution is using
backgroundImagefor the background image andbackgroundRepeatfor the repetition since that will not touch other background options which might already exist.Another solution would be setting
backgroundtourl(...) no-repeat