[Answer]-CSS targetting problems when using Django

0👍

Figured out the problem myself.

Had a chunk of

* {
    font-family: Sans-serif;
    color: #555;
    margin: 0;
    padding: 0;
    background: #F5F5F5;
}

In my css-file which overruled the background for my div even if I added code below that snippet. Is this normal though?

1👍

It may be the order in which Django serves up the static assets. Are you running collectstatic?

In any event, you should be able to definitively declare the background color as follows:

#container {
    background: black;
}

#container p {
    background: black;
}

0👍

It doesn’t have anything to do with django or python.

There must be a specific style somewhere for that p tag. You probably have included a css framework or possibly a reset stylesheet.

👤Renkai

Leave a comment