In the code snippet below, I've introduced another div.website-thumbnail
. However, the div containing
<span class="website-title">Business Coach</span>
appears isolated on its own line, almost as if it has clear: left;
applied to it. None of the other div.website-thumbnails
align on the same line as the one with <span class="website-title">Business Coach</span>
.
.website-thumbnail {width: calc(25% - 10px); float: left; margin: 5px;}
.website-thumbnail img {max-width: 100%;}
.website-title {display: inline-block; text-align: center; width: 100%; background-color: #ec0c8d; color: white; padding: 5px 0;}
@media (max-width: 900px) {
.website-thumbnail {width: calc(33% - 10px);}
}
@media (max-width: 700px) {
.website-thumbnail {width: calc(50% - 10px);}
}
<div class="website-thumbnail"><span class="website-title">Accountant</span><a href="/accountant/" target="_blank" rel="noopener noreferrer"><img title="Accountant Website Design" src="https://websites.insightdesign.com.au/wp-content/uploads/2019/03/websites-insightdesign-accountant.jpg" /></a></div>
... more website thumbnails...
To observe the issue in a desktop viewport, you'll need to click "Expand snippet," where the problem originates.
Your assistance would be highly appreciated.
You can witness the live effect at the specified link, on the 4th row of screenshots displayed on a desktop screen.