I want my website to remain the same regardless of window resizing, ensuring that no elements on the page shift or change size. Currently, my image and buttons are moving and resizing with the window, which I don't want.
* {
box-sizing: border-box; }
#wrapper {
margin-left:auto;
margin-right:auto;
width:100%;
height: 100%;
}
body {
background-color: black;
font-family: "Source Sans Pro", sans-serif;
text-align: center;
color: #ccc;
}
div {
height: 100%;
}
canvas {
position: absolute;
width: 100%;
height: 100%;
top: 0;
right: 0;
left: 0;
bottom: 0;
}
h3 {
position: absolute;
font-size: 100px;
font-weight: 100;
color: white;
margin-top: 70px;
margin-left: 80px;
}
img {
margin-top: 230px;
margin-right: 0px;
}
.home {
position: absolute;
border: 2px solid #CCCCCC;
text-align: center;
color: #ccc;
font-size: 26px;
line-height: 60px;
width: 10%;
height: 60px;
margin-top: 180px;
margin-left: 500px;
}
.about {
position: absolute;
border: 2px solid #CCCCCC;
text-align: center;
color: #ccc;
font-size: 26px;
line-height: 60px;
width: 10%;
height: 60px;
margin-top: 180px;
margin-left: 750px;
}
.projects {
position: absolute;
border: 2px solid #CCCCCC;
text-align: center;
color: #ccc;
line-height: 60px;
width: 10%;
height: 60px;
font-size: 26px;
margin-top: 180px;
margin-left: 1000px;
}
.contact {
position: absolute;
border: 2px solid #CCCCCC;
text-align: center;
color: #ccc;
line-height: 60px;
font-size: 26px;
width: 10%;
height: 60px;
margin-top: 180px;
margin-left: 1250px;
}
.home:hover{
border-color: #0091FF;
color: #0091FF;
}
.about:hover{
border-color: #0091FF;
color: #0091FF;
}
.projects:hover{
border-color: #0091FF;
color: #0091FF;
}
.contact:hover{
border-color: #0091FF;
color: #0091FF;
}
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Play" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="styles.css" />
<script type="text/javascript" src="background.js"></script>
<title>Home</title>
</head>
<body>
<div id="wrapper">
<canvas class='connecting-dots'></canvas>
<h3>Title</h3>
<a href="#"><div class = "home">Home</div></a>
<a href="#"><div class = "about">About</div></a>
<a href="#"><div class = "projects">Projects</div></a>
<a href="#"><div class = "contact">Contact</div></a>
<img src="astronaut.png">
</div>
</body>
</html>