help with positioning problem

linkzerone

Well-Known Member
OP
Newcomer
Joined
Oct 24, 2016
Messages
47
Trophies
0
Age
26
XP
97
Country
Canada
I am doing a project for school and am stuck. Why is the height of the browser window so big after everything was position relatively.

html

<!DOCTYPE html>
<html>
<head>
<title>Vision Board</title>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<header>
<div class="container">
<nav>
<ul>
<li><a href="#">5 years</a></li>
<li><a href="index2.html">10 years</a></li>
<li><a href="index3.html">Online resources</a></li>
</ul>
</nav>
</div>
</header>
<main>
<div class="container">
<div id="title" class="square">
<h1>Were I See Myself in Five Years</h1>
</div>
<div id="education" class="square">
<h3>education</h3>
<img src="img/700-20000-Master%2Bof%2BComputer%2BScience.jpg">
<img src="img/700-3720-BACHELOR-of-BUSINESS-ADMINISTRATION-DEGREE-in-MANAGEMENTwith-ACCOUNTING.jpg">
<img src="img/700-490-Masters-Degree-of-Business-Administration.jpg">
<img src="img/700-5422-Bachelor%2Bdegree%2Bof%2Bcomputer%2Bscience.jpg">
</div>
<div class="circle">
<h3>electives</h3>
<img src="img/download%20%281%29.jpg" alt="">
<img src="img/main-qimg-e7988d669093b148ea4f52e7dee63499.png" alt="">
<img src="img/Featured-Anime-Voice-Actor.jpg" alt="">
<img src="img/000012225873.jpg" alt="">
</div>
<div class="circle">
<h3>adult upgrading</h3>
</div>
<div id="employment" class="square">
<h3>employment</h3>
<img src="img/08227dbd1a066b405fdbaced967bcc37.jpg">
</div>
<div id="recreational" class="square">
<h3>recreational</h3>
<img src="img/7908.jpg">
<img src="img/7fbe50ec634c65709d7fe6ac267c4e6f--large-garage-plans-house-plans-large-family.jpg">
<img src="img/download%20%282%29.jpg">
<img src="img/download.png">
</div>
</div>
</main>
<script src="js/main.js"></script>
</body>
</html>

css

*{box-sizing: border-box; margin:0; padding:0}
header{margin-bottom:75px; background:blue}
img{height:150px; width:150px; position:relative; z-index:-1}
#title{height:250px; width:250px; margin: auto; top:145px;}
#employment{bottom:231px; left:15%;}
#education{bottom:106px; left:75%;}
#recreational{bottom:0; margin:0 auto;}
.container{margin:0 auto; width:80%;}
.circle{border:1px solid black; border-radius:50%; height:125px; width:125px;
text-align:center; position: relative; padding: 45px 5px}
.square{border:1px solid black; height:125px; width:125px;
text-align:center; position:relative; padding:45px 5px;}

js

var circle = document.getElementsByClassName("circle");
var img = document.getElementsByTagName("img");
/*square positioning*/
/*circle positioning*/
/*elective circle*/
circle[0].style.left= "950px";
circle[0].style.top = "125px"
/*adult upgrading*/
circle[1].style.left= "540px";
circle[1].style.top= "-500px"
/*image positioning*/
/*masters degree cs*/
img[0].style.bottom = "215px";
img[0].style.left = "140px";
/*bachelor degree ba*/
img[1].style.bottom = "102px";
img[1].style.right = "178px";
/*masters degree ba*/
img[2].style.bottom = "256px";
img[2].style.left = "140px";
/*bachelor degree cs*/
img[3].style.bottom = "676px";
img[3].style.right = "175px";
/*graphic design*/
img[4].style.bottom = "120px";
img[4].style.right = "200px";
/*programming language*/
img[5].style.bottom = "120px";
img[5].style.right = "140px";
/*voice acting*/
img[6].style.bottom = "250px";
img[6].style.left = "100px";
/*computer psychology*/
img[7].style.bottom = "582px";
img[7].style.left = "150px"
/*software companies*/
img[8].style.bottom = "432px";
img[8].style.left = "-110px"
img[8].style.width = "350px"
img[8].style.height = "350px"
/*truck*/
img[9].style.bottom = "80px";
img[9].style.right = "550px";
/*house*/
img[10].style.bottom = "550px";
img[10].style.right = "200px";
img[10].style.width = "300px";
img[10].style.height = "300px";
/*girlfriend*/
img[11].style.bottom = "550px";
img[11].style.right = "200px";
/*traveling*/
img[12].style.bottom = "880px";
img[12].style.right = "550px";
img[12].style.width = "290px";
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    LeoTCK @ LeoTCK: hmm