Issue
Question:
I have div boxes lined side by side with arrows pointing. I want to write content above the arrow using html css. How can I do that?
#border {
height: 80px;
width: 10%;
border: 1px black solid;
display: inline-block;
}
#borders {
height: 80px;
width: 10%;
border: 1px black solid;
display: inline-block;
}
#borderss {
height: 80px;
width: 10%;
border: 1px black solid;
display: inline-block;
}
#bordersss {
height: 80px;
width: 10%;
border: 1px black solid;
display: inline-block;
}
.arrow {
font-size: 105px;
color: red;
width:115%
}
<div id="border"></div><span class="arrow">→</span>
<div id="borders"></div>
<span class="arrow">→</span>
<div id="borderss"></div>
<span class="arrow">→</span>
<div id="bordersss">
</div>
Codepen link: https://codepen.io/acqafqe/pen/yLEJgVv
Solution
I did it adding flex-layout and some additional styles:
Presentation
#main-content {
display: flex;
flex-direction: row;
align-items: center;
}
#border {
height: 80px;
width: 10%;
border: 1px black solid;
display: inline-block;
}
#borders {
height: 80px;
width: 10%;
border: 1px black solid;
display: inline-block;
}
#borderss {
height: 80px;
width: 10%;
border: 1px black solid;
display: inline-block;
}
#bordersss {
height: 80px;
width: 10%;
border: 1px black solid;
display: inline-block;
}
.arrow {
font-size: 105px;
color: red;
width:100px;
margin-top: -60px;
}
.arrow-flex {
display: flex;
flex-direction: column;
align-items: center;
padding-top: 50px;
}
<div id="main-content">
<div id="border"></div>
<div class="arrow-flex">
<span>text</span>
<span class="arrow">→</span>
</div>
<div id="borders"></div>
<div class="arrow-flex">
<span>text</span>
<span class="arrow">→</span>
</div>
<div id="borderss"></div>
<div class="arrow-flex">
<span>text</span>
<span class="arrow">→</span>
</div>
<div id="bordersss">
</div>
</div>
Answered By - Bryan Carrera Answer Checked By - Clifford M. (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.