I want to make a design like this using css, but i don't know how to put this button on top between two div
s, can anyone help me?
<div></div>
button
<div></div>
I want to make a design like this using css, but i don't know how to put this button on top between two div
s, can anyone help me?
<div></div>
button
<div></div>
You can also use negative margin-top
to pull your element up.
Make the button style position: absolute;
and define the right
and top
or bottom
properties.
If you want the button to be fixed while scrolling, set position: fixed;
#up{
background-color:#B7005D;
height:10vh;
width:100%;
}
#middle{
background-color:#E0E1E0;
height:40vh;
width:100%;
}
#floating-button{
width: 50px;
height: 50px;
border-radius: 50%;
background: #B7005D;
position: fixed;
top: calc(50% - 25px);
right: 30px;
cursor: pointer;
box-shadow: 0px 2px 5px #666;
}
<div id="up"></div>
<div id="middle"></div>
<div id="floating-button"></div>