Drop Cap Initials
Dropped, raised and hanging initials opening a paragraph, with size and colour controls.
AI prompt
Editorial magazine page close-up of an article opening with a large serif drop cap T in dark red spanning three lines of body text, the top of the letter aligned with the first line's capital height and the bottom with the third line's baseline, elegant serif body copy, generous margins, off-white paper. Variants: a raised initial on the first baseline and a hanging initial in the left margin. Negative: misaligned letter, decorative flourishes, extra text errors. Reduced motion: still image.About this pattern
Definition
A drop cap marks the start of an article and adds editorial character. A dropped initial sits inside the first lines, a raised initial stands on the baseline and grows upwards, and a hanging initial sits in the margin. Each should align with the text lines so the paragraph still looks tidy.
When to use it
- Dropped: the letter spans two to four lines; its top aligns with the cap height of the first line and its base with the baseline of the last line it covers.
- Raised: the letter is bigger and shares the first baseline.
- Hanging: the letter sits to the left of the text block.
- CSS initial-letter does this natively where supported; a float with tuned line-height is the fallback.
What the controls do
- Three style buttons, a Lines slider for the drop depth and an accent colour switch.
Motion & timing
- Updates are immediate.
- Reduced motion: nothing animates.
Tips & variations
- Keep real text in the paragraph so screen readers read it normally.
- Avoid drop caps on very short paragraphs.
Code of this live preview
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Initial"><button data-p="0" aria-pressed="true">Dropped</button><button data-p="1" aria-pressed="false">Raised</button><button data-p="2" aria-pressed="false">Hanging</button></div><p class="pg" id="pg"><span class="ic" id="ic">T</span>he old harbour wakes slowly. Fishermen carry crates along the quay while gulls circle above the market, and by the time the sun clears the hills the first coffee is already poured. It is a place that rewards anyone willing to arrive early and stay a little longer than planned.</p><div class="two"><label class="rw">Lines <b id="lv">3</b><input id="ls" type="range" min="2" max="4" value="3"></label><label class="sw"><input id="ac" type="checkbox" checked> Accent colour</label></div></div>:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}a{color:inherit;text-decoration:none}ul,ol,p,h4{margin:0;padding:0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.pre{display:flex;gap:5px;flex-wrap:wrap}.pre button{height:28px;padding:0 11px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.bx{width:min(330px,100%);display:grid;gap:9px}.rw{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.rw b{color:var(--text);font-weight:600}input[type=range]{width:100%;accent-color:#171717}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.pg{font:15px/22px Georgia,'Times New Roman',serif;margin:0 0 8px;padding:10px 12px 10px 12px;border:1px solid var(--line);border-radius:12px;background:#fff;overflow:hidden}.ic{font-family:Georgia,serif;font-weight:700;color:var(--ac,#9b2d20)}.pg.d .ic{float:left;font-size:calc(22px*var(--n,3)*1.12);line-height:.8;padding:5px 7px 0 0;margin-top:2px}.pg.r .ic{font-size:40px;line-height:22px}.pg.h{padding-left:36px}.pg.h .ic{float:left;margin-left:-26px;font-size:42px;line-height:.9;width:26px;margin-right:0}.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}.sw{display:flex;gap:6px;align-items:center;font-size:12px;color:var(--muted)}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const pg=document.getElementById('pg'),ic=document.getElementById('ic'),ls=document.getElementById('ls'),ac=document.getElementById('ac'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){pg.className='pg '+['d','r','h'][p];pg.style.setProperty('--n',ls.value);pg.style.setProperty('--ac',ac.checked?'#9b2d20':'#171717');document.getElementById('lv').textContent=ls.value;ls.disabled=p!==0;bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));ls.addEventListener('input',up);ac.addEventListener('change',up);up();One complete HTML file. Save it and open it in a browser.
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Drop Cap Initials — demo</title>
<style>
:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
html,body{height:100%}body{background:var(--bg);color:var(--text);font:15px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',Inter,Roboto,sans-serif;-webkit-font-smoothing:antialiased}.stage{min-height:100%;display:grid;place-items:center;padding:24px}button,input,select,textarea{font-family:inherit}@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}a{color:inherit;text-decoration:none}ul,ol,p,h4{margin:0;padding:0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.pre{display:flex;gap:5px;flex-wrap:wrap}.pre button{height:28px;padding:0 11px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.bx{width:min(330px,100%);display:grid;gap:9px}.rw{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.rw b{color:var(--text);font-weight:600}input[type=range]{width:100%;accent-color:#171717}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.pg{font:15px/22px Georgia,'Times New Roman',serif;margin:0 0 8px;padding:10px 12px 10px 12px;border:1px solid var(--line);border-radius:12px;background:#fff;overflow:hidden}.ic{font-family:Georgia,serif;font-weight:700;color:var(--ac,#9b2d20)}.pg.d .ic{float:left;font-size:calc(22px*var(--n,3)*1.12);line-height:.8;padding:5px 7px 0 0;margin-top:2px}.pg.r .ic{font-size:40px;line-height:22px}.pg.h{padding-left:36px}.pg.h .ic{float:left;margin-left:-26px;font-size:42px;line-height:.9;width:26px;margin-right:0}.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}.sw{display:flex;gap:6px;align-items:center;font-size:12px;color:var(--muted)}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Initial"><button data-p="0" aria-pressed="true">Dropped</button><button data-p="1" aria-pressed="false">Raised</button><button data-p="2" aria-pressed="false">Hanging</button></div><p class="pg" id="pg"><span class="ic" id="ic">T</span>he old harbour wakes slowly. Fishermen carry crates along the quay while gulls circle above the market, and by the time the sun clears the hills the first coffee is already poured. It is a place that rewards anyone willing to arrive early and stay a little longer than planned.</p><div class="two"><label class="rw">Lines <b id="lv">3</b><input id="ls" type="range" min="2" max="4" value="3"></label><label class="sw"><input id="ac" type="checkbox" checked> Accent colour</label></div></div>
</div>
<script>
const pg=document.getElementById('pg'),ic=document.getElementById('ic'),ls=document.getElementById('ls'),ac=document.getElementById('ac'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){pg.className='pg '+['d','r','h'][p];pg.style.setProperty('--n',ls.value);pg.style.setProperty('--ac',ac.checked?'#9b2d20':'#171717');document.getElementById('lv').textContent=ls.value;ls.disabled=p!==0;bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));ls.addEventListener('input',up);ac.addEventListener('change',up);up();
</script>
</body></html>