I have an unordered list of images with a text overlay at the bottom of each image. The text overlay are inline blocks with different background color.
First I get a whitespace in between the background colors which I do not need. ✔️
Secondly, the left inline block has a fixed width while the right needs to cover up the remaining width ✔️
Thirdly, the second block should have another element which is hidden and ought to show on hover
Lastly I want the two blocks to have an even height at all times when the height of either of them changes
EDIT Paragraph div needs to show on hover. Also I want the height of the inline blocks to come out even whenever either of them changes.
This is what I have so far
.slideList {
width: 100%;
}
.slideList li {
position:relative;
}
.slideList .service-highlight {
position: absolute;
color: white;
bottom: 0;
left: 0;
right:0
}
.slideList .service-highlight p {
display: inline-block;
color: white;
font-size: 18px;
font-weight: bold;
}
.slideList .service-highlight .services-box{
text-align: center;
background-color: #003768;
width: 200px;
font-weight: bold;
float: left;
}
.slideList .service-highlight .services-detail{
background-color: #0088ff;
width:calc(100% - 200px);
float: left;
padding-left: 5px;
}
.slideList .hide-description {
display: none;
font-weight:normal;
}
.slideList .hide-description p {
font-weight:normal;
padding-top: 10px 5px 10px;
}
.services-detail:hover + .hide-description {
display: block;
position: absolute;
}
.clearFloat {
clear: both;
}
<ul class="slideList">
<li data-transition="fade">
<img src="https://images.unsplash.com/photo-1532274402911-5a369e4c4bb5?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80" >
<div class="service-highlight">
<p class="services-box">SOME SERVICE:</p>
<div class="services-detail">
<p>Some headline</p>
<div class="hide-description">
<p>Some text that appears here. Text describes some service I intend to achieve. This may or may not take up to three lines maybe two </p>
</div>
</div>
</div>
</li>
<ul>