<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>index</title>
<style>
@charset "utf-8";
/* CSS Document */
*{
margin: 0;
padding: 0;
}
body{
font-family: Verdana, Geneva CY, Helvetica, DejaVu Sans, Arial, sans-serif;
font-size: .8rem;
line-height: 160%;
}
main{
width: 100vw;
height: 100vh;
background-image: url("../images/color.png");
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
transition: background-image 2s;
display: grid;
justify-items: center;
justify-content: center;
grid-template-rows: minmax(320px, 640px) auto;
grid-template-columns: 1fr;
grid-area:
"header"
"nav";
}
header{
grid-area: "header";
font-family: Constantia, "Lucida Bright", "DejaVu Serif", Georgia, "serif";
font-size: 5.5rem;
color: #fff;
text-shadow: 0px 0px 3px #423F3B;
align-self: end;
}
nav{
grid-area: "nav";
margin: 60px 0px 0px 0px;
}
ul{
display: flex;
justify-content: center;
}
li{
list-style: none;
cursor: pointer;
margin: 0px 20px 0px 20px;
}
li:nth-child(1){
}
li:nth-child(2){
}
li:nth-child(3){
}
li:nth-child(4){
}
li:nth-child(5){
}
</style>
</head>
<body>
<main>
<header>
Шарлин Корзе
</header>
<nav>
<ul>
<li>Page</li>
<li>Page</li>
<li>Page</li>
<li>Page</li>
<li>Page</li>
</ul>
</nav>
</main>
<script>
let main = document.querySelector("main");
let li_1 = document.querySelector("li:nth-child(1)");
let li_2 = document.querySelector("li:nth-child(2)");
let li_3 = document.querySelector("li:nth-child(3)");
let li_4 = document.querySelector("li:nth-child(4)");
let li_5 = document.querySelector("li:nth-child(5)");
li_1.onmouseover = test1;
function test1(){
main.style.backgroundImage = "url('images/pic6.jpg')";
}
li_1.onmouseout = test2;
function test2(){
main.style.backgroundImage = "url('images/color.png')";
}
</script>
</body>
</html>