Performance: Card structure (header, body, footer)
MEDIUM IMPACT
This affects page load speed and rendering performance by how many DOM elements and CSS styles are used in the card layout.
<div class="card"> <div class="card-header"> <h5>Title</h5> <small>Subtitle</small> </div> <div class="card-body"> <p>Some text content here.</p> <button type="button">Click me</button> </div> <div class="card-footer"> <small>Footer info</small> </div> </div>
<div class="card"> <div class="card-header"> <h5>Title</h5> <div><small>Subtitle</small></div> </div> <div class="card-body"> <p>Some text content here.</p> <div><button type="button">Click me</button></div> </div> <div class="card-footer"> <small>Footer info</small> </div> </div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Nested divs inside card sections | High (many nodes) | Multiple reflows | High paint cost | [X] Bad |
| Flat structure with semantic Bootstrap classes | Low (fewer nodes) | Single reflow | Low paint cost | [OK] Good |