I am using Bootstrap v5.3 to create a card layout, and I want it to be SEO-friendly (see this link for my SEO-friendly criteria).
Below is my card component I wish to optimize and, if possible, to drop some classes from <div>
elements for cleaner markup.
I am considering to put all styling inside a style file, which is represented here as style tag. If I will go for that option, then how do I organize these styles?
What are other objective flaws in my markup as you can tell?
<link href="https://getbootstrap.com/docs/5.0/dist/css/bootstrap.min.css" rel="stylesheet"/>
<style>
.card-custom {
width: 400px;
}
</style>
<div class="card-custom rounded-2 shadow-sm d-flex flex-column">
<img src="https://i.imgur.com/wNabyl4.jpg" class="card-img-top rounded-0" alt="Hello World" />
<div class="px-3 py-3 d-flex flex-column justify-content-between gap-4 flex-grow-1">
<div>
Subheader Line
</div>
<div class="text-break flex-grow-1">
<h3 class="fw-bold fs-4">Card Title</h3>
Content Content Content of Dynamic Length
</div>
<div>
Footer of Static Length
</div>
</div>
</div>