I'm struggling with finding a way to move the button to the right-bottom of the div parent box. I tried float: right;
then, it is moved to the outside of the div box. How can I move the button within the box to the right-bottom?
and If you know, please explain why float:right; makes button move out of the box!
.color {
border: 1px solid black;
width: 70%;
margin: 10px auto;
padding: 0 30px;
position: relative;
}
.color p {
display: inline-block;
width: 200px;
height: 80px;
margin-right: 10px;
text-align: center;
line-height: 78px;
}
p.black {
background: black;
color: white;
}
p.gray {
background: gray;
color: white;
}
p.blue {
background: blue;
color: white;
}
p.white {
border: 1px solid black;
}
.btn a {
display: inline-block;
border: 1px solid black;
color: black;
padding: 10px;
margin: 10px 0;
text-decoration: none;
font-size: 90%;
font-weight: 700;
border-radius: 50px;
text-align: center;
box-shadow: inset 0 0 0 0 #000000;
transition: ease-out .2s;
}
.color .btn a:hover {
box-shadow: inset 133px 0 0 0 #000000;
color: white;
}
<div class="color">
<h1 class="heading">Color</h1>
<p class="black">black</p>
<p class="gray">gray</p>
<p class="white">white</p>
<p class="blue">blue</p>
<div class="btn"><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color_value" target="_blank">See more colors</a></div>
</div>