<!DOCTYPE html>
<html lang="PL">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Parallax sscrolling effect</title>
<style>
body{
margin: 0;
padding: 0;
}
#logo{
background-image: url(scooter.webp);
background-position: center;
background-size: cover;
width: 100%;
height: 100%;
position: relative;
}
#logo::after{
content: " ";
background-color: rgba(0, 0, 0, 0.35);
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 100%;
}
#logo2{
height: 1080px;
width: 1920px;
}
</style>
</head>
<body>
<div id="container">
<div id="logo">
<div id="logo2">Scooter</div>
</div>
</div>
<script>
var w = window.innerWidth;
var h = windows.innerHeight;
document.getElementById("container").style.width = w;
document.getElementById("container").style.height = h;
</script>
</body>
</html>
Witam,
chciałbym, aby ten skrypt (dół dokumentu) ustawiał #container na te same rozmiary co rozmiar dostępnego miejsca w oknie przeglądarki. Ale niestety nie działa, jest w stanie ktoś pomóc?
Z góry dziękuje za wszystkie odpowiedzi,