Bobo
unread,Sep 30, 2008, 5:13:56 AM9/30/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Hi everyone,
I'm having a very strange problem with my Django project. I’ve a menu
with several links but I want to make a hover effect with it and for
that I use pictures.
The problem is that my path in my CSS won’t work and the pictures
aren’t loaded and therefore not shown in the menu.
My structure looks like this:
Djangoapps > myDjangoApp > urls.py
Djangoapps > myDjangoApp > skema > views.py
Djangotemplates > base.html (in here lie my menu section and it’s also
here I load the css file default.css)
Html > site_media > css > default.css
Html > site_media > img > a_hover.jpg
Html > site_media > img > menu.jpg
In my css file I have this code:
#menu {
width:100%;
padding-top:20px;
padding-bottom:20px;
background-color:#003399;
color:#FFFFFF;
text-align:center;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:11px;
font-variant:small-caps;
background-image: url('/site_media/img/menu.jpg');
}
#menu a {
color:#FFFFFF;
text-decoration:none;
padding:10px;
padding-top:20px;
padding-bottom:20px;
font-weight:bold;
}
#menu a:hover {
border-bottom:1px solid #ffffff;
border-left:1px solid #728d40;
border-right:1px solid #e9ffb7;
padding-left:9px;
padding-right:9px;
color:#000000;
background-color:#FFFFFF;
background-image:url(../img/menu.jpg);
font-weight:bold;
The problem here is the two lines:
background-image: url('/site_media/img/menu.jpg');
and
background-image:url(/site_media/img/menu.jpg);
I know they are different but that’s because I’ve tried so many
different combinations, like /site_media/img/menu.jpg but also ../img/
menu.jpg and so forth.
I’m simply run out of ideas but hopefully you can give me an answer on
what the heg it’s wrong.
I should say that the base.html correctly load the css file in and all
other css classes are correct and applied to the tables and div’s.
Thank you
- Emil