1

main.css

body{
    width:100%;
    height:100%;
    overflow:hidden;
    background:url('/assets/background-calculations.png');
}
body #content{
    z-index:5;
    background:url('/assets/handwritten-text.png');
//  background:white;
    width:100%;
    height:100px;
}
body #footer,#header{
    height:100px;
    width:100%;
    margin:0 auto;
}

index.html.erb is blank

doubt

when i uncomment background:white; in content css its working but when i set the background url its not working , but the same url does not work if i set it for the content div , please help

4
  • Can you provide the full link to the background image? I cannot check your CSS without it :) Commented Aug 13, 2012 at 3:50
  • currently talking about development environment, the thing is that when i use the background image for body , its working but for other divs its not working Commented Aug 13, 2012 at 3:56
  • for instance body{ background:url('/assets/handwritten-text.png'); } is working but the above is not Commented Aug 13, 2012 at 4:01
  • can uou post a demo at jsfiddle.net? Commented Aug 13, 2012 at 6:57

2 Answers 2

2

if you work in a ruby-on-rails, you have a assets > images. put images in there.

In your stylesheets folder (assets > stylesheets) you have to point to the image, not the folder and image:

body{
    width:100%;
    height:100%;
    overflow:hidden;
    background:url(background-calculations.png);
}
body #content{
    z-index:5;
    background:url(handwritten-text.png);
    width:100%;
    height:100px;
}

Ruby-on-rails knows where your images are

Sign up to request clarification or add additional context in comments.

Comments

1

Try something like;

body #content{
    z-index:5;
    background-image:url('/assets/handwritten-text.png');
    background-color:white;
    width:100%;
    height:100px;
}

Here is a working live demo.

1 Comment

can't you see the blue background image in my fiddle?

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.