D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
coakenfold
Full window
Github gist
Center text around the 6 o'clock position of a circle
<div class="container"> <h1>Center text around the 6 o'clock position of a circle</h1> <div class="circle"> <svg class="" viewBox="0 0 88 88" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink"> <defs> <path id="CirclePath1" d="M2,44a42,42 0 1,0 84,0a42,42 0 1,0 -84,0"/> </defs> <use xlink:href="#CirclePath1" /> <text> <textPath id="circle1" xlink:href="#CirclePath1"></textPath> </text> </svg> </div> <div class="circle"> <svg class="" viewBox="0 0 88 88" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink"> <defs> <path id="CirclePath2" d="M2,44a42,42 0 1,0 84,0a42,42 0 1,0 -84,0"/> </defs> <use xlink:href="#CirclePath2" /> <text> <textPath id="circle2" xlink:href="#CirclePath2"></textPath> </text> </svg> </div> <hr> <div class="circle"> <svg viewBox="0 0 88 88" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink"> <defs> <path id="CirclePath3" d="M2,44a42,42 0 1,0 84,0a42,42 0 1,0 -84,0"/> </defs> <use xlink:href="#CirclePath3" /> <text> <textPath id="circle3" xlink:href="#CirclePath3"></textPath> </text> </svg> </div> <div class="circle"> <svg viewBox="0 0 88 88" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink"> <defs> <path id="CirclePath4" d="M2,44a42,42 0 1,0 84,0a42,42 0 1,0 -84,0" /> </defs> <use xlink:href="#CirclePath4" /> <text> <textPath id="circle4" xlink:href="#CirclePath4"></textPath> </text> </svg> </div> </div>