Answer the question
In order to leave comments, you need to log in
Change inside html and not css?
There is a code for the header on the page.
So, how to change it inside the page itself but without the style tag like in the code below? Could this be possible at all?
I want to use in django to generate posts from the admin panel with different images for posts.
header {
position: relative;
width: 100%;
min-height: auto;
text-align: center;
color: #fff;
background-image: url(../img/header.jpg);
background-position: center;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
}
<style type="text/css">
header
{
background-image: url(img/header.jpg);
}
</style>
</head>
Answer the question
In order to leave comments, you need to log in
Have you tried inline styles?
<header style="background-image: url(img/header.jpg);">...</header>
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
You can do this on a specific element on any of the pages. Like this:
...
</head>
<body>
<header style='background-image: url(img/header.jpg);'>
контент
</header>
...
ah, I'm not the only one who knows about inline styles :(
and it's probably even better this way.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question