I'm working on creating a responsive horizontal timeline using Bootstrap 4 for my timeline and project. The code I've developed so far is working well in terms of being responsive.
timeline.html
<div className="container timeline-container">
<div class="intro">
<div class="main-heading">
<div class="three-col top">
<div class="col">
<div class="sub-heading">
<div class="square">
<div class="pic">
</div>
</div>
</div>
</div>
<div class="col">
<div class="sub-heading">
<div class="square">
<div class="pic">
</div>
</div>
</div>
</div>
<div class="col">
<div class="sub-heading">
<div class="square">
<div class="pic">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="main-heading">
<div class="three-col bottom">
<div className="wrapper-bottom">
<div class="col">
<div class="timeline-dot">
</div>
<div class="sub-heading">
<div class="square">
<div class="pic">
</div>
</div>
</div>
</div>
<div class="col">
<div class="timeline-dot">
</div>
<div class="sub-heading">
<div class="square">
<div class="pic">
</div>
</div>
</div>
</div>
<div class="col">
<div class="timeline-dot">
</div>
<div class="sub-heading">
<div class="square">
<div class="pic">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
style.css
.container.timeline-container{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
* {
box-sizing: border-box;
}
.intro {
position: relative;
}
.square {
width: 100px;
height: 100px;
margin: 25px;
transform:rotate(45deg);
overflow: hidden;
}
.pic {
background: url(http://placekitten.com/g/150/150);
width: 150px;
height: 150px;
margin: -25px;
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
.timeline-dot {
width: 10px;
height: 10px;
border-radius: 20px;
margin: 0 auto;
background: #CF4532;
margin-top: -6px;
}
.main-heading {
text-align: center;
font-size: 30px;
line-height: 30px;
position: relative;
}
.three-col.bottom{
border-top: 2px solid #4A4A4A;
}
.three-col:after {
display: block;
clear: both;
content: '';
}
.three-col .col {
float: left;
width: 33.33%;
position: relative;
padding: 0 20px;
}
.sub-heading {
position: relative;
display: inline-block;
padding: 20px 0;
}
My timeline appears like this:
https://i.sstatic.net/RJ3cF.png
There are two things I want to change:
1) Remove the lines before the first and after the last dot so the timeline looks like this https://i.sstatic.net/L8z8V.png
2) Make the picture squares responsive.
I tried adjusting the parent div
like this
.sub-heading {
position: relative;
display: inline-block;
padding: 20px 0;
width: 400px;
height: 400px;
}
And for the picture square:
.square {
width: 100%;
height: 100%;
margin: 25px;
transform:rotate(45deg);
overflow: hidden;
}
But it's not working as expected. Any advice would be greatly appreciated.