The body of my website doesn’t have a specific height so I can not find the exact size of that. I want to show a line from top to down like this:
.lines {
height: 100%;
position: absolute;
background-color: #000;
height: 100%;
width: 20px;
position: absolute;
right: 50%;
top:0;
}
.div1 {
background-color: red;
width: 500px;
height: 500px;
}
.div2 {
margin-top: 20px;
background-color: blue;
width: 500px;
height: 500px;
}
<body>
<div class="lines">
</div>
<div class="div1">
</div>
<div class="div2">
</div>
</body>
but I can not find the exact height of my body. and height: 100%;
just fill in a part of the website.
3
Answers
Have a look at this post
I suggest looking in here by using
height: 100vh;
Change
.lines
to be toposition: fixed
.