Performance: Lead paragraphs
Lead paragraphs affect the initial page load and rendering speed by adding styled text elements that can impact layout and paint times.
<p class="lead">Welcome to our site!</p>
<p class="lead" style="font-size: 2rem; font-weight: 700;">Welcome to our site!</p>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Bootstrap lead class only | Minimal (1 paragraph node) | 0-1 reflow | Low paint cost | [OK] Good |
| Lead paragraph with inline styles | Minimal (1 paragraph node) | 1 reflow | Medium paint cost | [!] OK |
| Multiple lead paragraphs with heavy inline styles | Multiple nodes | Multiple reflows | High paint cost | [X] Bad |
class="lead" on a paragraph in Bootstrap?class="lead"lead.class="lead" on a <p> tag is correct.<lead> do not exist, and attributes like lead without class or wrong class names are invalid.class="lead" on <p> = B [OK]<p>Normal paragraph text.</p> <p class="lead">Lead paragraph text.</p>
lead class makes text bigger and lighter to stand out visually.<p class="lead">Important text here.</p>
lead class styling comes from Bootstrap CSS, so it requires the CSS file to be linked.class="lead" only to the important paragraph keeps the page clear and easy to read.Pass the test and this pattern moves unknown