+ 2
Why attribute background for <body> is not working in sl sandbox?
I found jpg background for my project and wrote image url in attribute, but background didnot change!
7 Réponses
+ 3
Please show us your code so that we can help you better.
In general, when setting a background image for the body tag use CSS:
body {
background-image: url("https://yourimage.url");
}
+ 2
You forgot the style tag.
<style>
body {
font-family: 'Mali', cursive;
white-space: nowrap;
background-image: url("https://i.pinimg.com/originals/a1/7c/fd/a17cfd26e7f4aa2a51e5542a6f7ed46c.jpg");
}
</style>
+ 1
body {
font-family: 'Mali', cursive;
white-space: nowrap;
background-image: url("https://i.pinimg.com/originals/a1/7c/fd/a17cfd26e7f4aa2a51e5542a6f7ed46c.jpg");
}
<body>
<div id="registration">
<div class="hello"><p>Hello, Player!<br />your name:</p></div>
<center><input type="text" id="nickname" placeholder="nickname" value=""/></center>
</div>
<center><div id="submit" type="submit">
<a onClick="submit()">Login</a>
</div></center>
<div class="version">
v-beta; all rights reserved
</div>
</body>
+ 1
But background still not change in sandbox
+ 1
I had style tag before, I just copied a part of the css code for <body>.
+ 1
I wrote the code on the php sandbox, but in the web sandbox the background changes
0
haha, make sure you write your code in the correct sandbox :D