To create a list of news with custom CSS (without using any bootstrap or similar library) displaying an image on the left side and content on the right side, I also need to include a div with the footer-block class below the content, aligned at the same y-coordinate as the image. However, the result appears slightly different:
I initially tried adjusting the properties in the .footer-block like this:
height: 24px;
position:relative;
bottom:-24px;
But it didn't produce the desired outcome.
How can this be resolved with a cross-platform solution?
.news-block-wrapper {
news-block-wrapper
}
.news-title {
width: 1094px;
height: 24px;
top: 20px;
left: 440px;
font-size: 20px;
line-height: 24px;
color: #D4D4E1;
text-transform: uppercase;
}
.news-img {
width: 400px;
height: auto;
top: 20px;
left: 20px;
margin-right: 20px;
/*border: 2px dotted yellow;*/
}
.news-content-wrapper {
display: inline;
width: 1332px;
height: 48px;
top: 54px;
left: 440px;
text-align: left;
font-weight: 400;
font-size: 14px;
line-height: 24px;
color: #B0B0BD;
}
.img-left-float {
float: left !important;
}
.news-row {
margin-bottom: 20px !important;
border: 2px dotted yellow;
height: 100%;
}
.footer-block {
border: 2px dotted red;
height: 24px;
position: relative;
bottom: -24px;
}
.news-content {
margin: 0;
margin-bottom: 10px;
padding: 2px;
line-height: 1.6em;
text-align: left;
}
.clear {
clear: both;
}
<div class="news-block-wrapper">
<div class="news-row">
<img src="https://loremflickr.com/860/640" class="img-left-float news-img" alt="Test news Maxime assumenda natus neque.">
<div class="news-content-wrapper">
<h5 class="news-title">
<a href="">
16=>Test news Maxime assumenda natus neque.
</a>
</h5>
<p class="news-content">Non qui vel quia excepturi. Dolorum ut voluptatem neque accusamus voluptatum.</p>
<div class="footer-block">
16=>Links
</div>
</div>
<div class="clear"></div>
</div>
<div class="news-row">
<img src="https://loremflickr.com/640/360" class="img-left-float news-img" alt="Test news Magni vel et impedit hic.">
<div class="news-content-wrapper">
<h5 class="news-title">
<a href="">
2=>Test news Magni vel et impedit hic.
</a>
</h5>
<p class="news-content">Repellat vero qui dolorem error perspiciatis itaque magni labore... [content truncated] ...et eum quas et nostrum labore.
Incidunt voluptas sit laudantium adipisci officiis incidunt dolores. Tempore cupiditate est ab cum eos sapiente.</p>
<div class="footer-block">
2=>Links
</div>
</div>
<div class="clear"></div>
</div>
</div>