Wanting to use a background image for my app !
I put in my layout layout file the following declaration just before the closing head tag ( .. </head> )
<style type="text/css">
body{
background-image:url('images/pattern.png');
font-family: 'Ubuntu', arial, sans-serif;
}
</style>
For some reason ..... it is not showing up ... I even tried to put it directly the css file ... it still does not show up as background.
I also tried writing it like this : background-image: URL('static','images/pattern.png'); it still does not work !
the "pattern.png" is well inside the images folder in the static folder of my app !
Can someone please tell me ... how come it is not working .. and how can I make my background image showing up as background image ( repeat xy should be considered by default so it was not specified ...) even when it is specified .. nothing shows up !
Please help .. please assist ...
I am sure this should be simple ! .. but it is not working !
Answers (2)
Comments (2)
0
ritika-sharma-11660 10 years ago
i also faced the sameproblem...................the real problem is url gets the value say with %29 appended at the end
bac
0
anthony 12 years ago
If the image is in the application's static folder, then the proper URL would be /yourapp/static/images/pattern.png. The URL you are using ("images/pattern.png") is a relative URL, so the browser will just add it to the URL of the current page, which obviously isn't correct. If you want to use the web2py URL() function to write the URL (good idea), then you have to put the code inside the web2py template delimiters, since it is Python code and not HTML/CSS:
replies (4)