0

I use all of these:

1. body{ background-image: url('example.png') background-repeat: repeat;
2. body{ background-image: url('assets/example.png') background-repeat: repeat;
3. body{ background-image: url(<%= asset_path 'example.png') background-repeat: repeat;
4. body{ background-image: image-url(<%= asset_path 'example.png' %>) background-repeat: repeat;
5. body{ background-image: image-url('example.png') background-repeat:repeat;
6. body{ background-image: image-url('assets/example.png') background-repeat:repeat;

run assets:precompile

not working all, how to solve this problem, why not working?

1
  • what is the extension of the css file ? Commented May 20, 2015 at 3:43

1 Answer 1

1

Number 5 is closest to the correct syntax. Is it because you're not terminating your first CSS rule with a semi-colon?

body{ 
  background-image: image-url('example.png');
  background-repeat:repeat;
}

That should work - note the semi-colon at the end of the background-image line.

Alternatively, merge them into a single rule:

body{ 
  background: image-url('example.png') repeat;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.