I am working with a set of three divs, each containing a .header
class and a .content
class. While I have managed to align the .header
class correctly, I am facing an issue with aligning the .content
class below the header with 10-15px padding on all sides. The text should be floated left for both the header and content. There must be a simple solution to this problem, but it seems to elude me.
<div class="container">
<div class="row">
<section>
<ul class="nav nav-wizard">
<li class="active">
<h5 class="header">
Header
</h5>
<p class="content">
Lorem ipsum dolorset amicum
</p>
</li>
<li class="active">
<h5 class="header">
Header
</h5>
<p class="content">
Lorem ipsum dolorset amicum
</p>
</li>
<li class="active">
<h5 class="header">
Header
</h5>
<p class="content">
Lorem ipsum dolorset amicum
</p>
</ul>
</section>
</div>
</div>
CSS
li {
width: 190px;
}
ul.nav-wizard:before {
position: absolute;
}
ul.nav-wizard li {
position: relative;
float: left;
height: 60px;
display: inline-block;
text-align: center;
padding: 0 20px 0 30px;
margin: 8px;
font-size: 16px;
line-height: 46px;
}
ul.nav-wizard li a {
color: #428bca;
padding: 0;
}
ul.nav-wizard li a:hover {
background-color: transparent;
}
li:last-child:before {
border-left: 16px #6633cc;
}
li:last-child:after {
position: absolute;
display: block;
border: 31px solid transparent;
border-left: 16px solid #6633cc;
border-right: 0;
top: -1px;
z-index: 10;
content: '';
right: -15px;
}
ul.nav-wizard li.active:nth-child(-n+2) {
background: #6633cc;
}
.header {
margin: 0 auto;
font-weight: bold;
float: left;
}
p {
float: left;
}
.content {
margin: -29px;
position: relative;
}
ul.nav-wizard .active ~ li {
color: #999999;
background: #ddd;
}
ul.nav-wizard .active ~ li:after {
border-left: 16px solid #ddd;
}
Current JSFIDDLE: https://jsfiddle.net/zfcm2y27/