views:

22

answers:

1

I'm having a problem with the django templating system.

I have a template with html, css, and js. When I use this template for my site, all of its margins and paddings change, and my template seems to become another template. For example margin 0 auto; seems to become margin 0 0;.

Note: I have a temp.html file and, for example, in the index of my home app, I have a file index.html that contains a {% extends "temp.html" %} tag and other block that they are in temp.html. (ed: ?)

If you need more code, please let me know.

A: 

You will need to make use of Django's built-in media hooks and relative URLs:

http://stackoverflow.com/questions/1023888/django-media-urls-in-css-files

jathanism
Tnx for your attention , my css and pictures load successfully .when i use my html file without any inheritance of django it shows without any changing , but when i use {% extends %} tag for inheritance my margins and padding and etc change a lot .
m.s.ansari
Have you tried viewing the source when the page is rendered using one template vs. the other? Are you storing your CSS and JS in separate files. If so, does the path to your linked CSS files change or remain the same? It would be helpful to see what your templates look like.
jathanism

related questions