I have implemented the following code to create a continuous running banner:
<style>
#myimage {
position: fixed;
left: 0%;
width: 100%;
bottom: 0%;
background:url("http://static.giga.de/wp-content/uploads/2014/08/tastatur-bildschirm-senkrechter-strich.jpg") repeat-x scroll 0% 0% / contain;
}
</style>
<div id="myimage">.</div>
<script>
var offset = 0
setInterval(function() {
offset +=1
document.getElementById("myimage").style.backgroundPosition = offset + 'px 0px';
},50)
</script>
https://i.stack.imgur.com/0kzny.png
Now I want every image to fill 100% of the screen size.
I considered simply adding the attribute ...
background-size: 100%;
... but it doesn't seem to work that way.
How can I ensure that each image's width is set to 100% of the screen's width without removing my existing style attributes?