html - Create a perfect circle having two lines of text -


using html/css, want create perfect circle 2 lines of centered text in image below. cleanest/most elegant way work in modern browsers? have declare width , height or can use padding/border-radius?

here jsfiddle.

html

<h2 class="score">92 <br>     <span class="text">overall</span> </h2> 

css

.score {    font-family: arial;    text-align: center;    background: #dcaa38;    border-radius: 50%;    padding: 15px;    font-size: 30px;    color: #fff;    margin-bottom: 0; }  .text {    position: relative;    margin-top: -20px !important;    font-weight: 100;    font-size: 12px; } 

enter image description here

please see here: fiddle need create square first

.container {     max-width: 500px; } .score {     font-family: arial;     text-align: center;     background: #dcaa38;     border-radius: 100px;     padding: 15px;     font-size: 30px;     height:100px;     width:100px;     color: #fff;     margin-bottom: 0; } .text {     position: relative;     margin-top: -20px !important;     font-weight: 100;     font-size: 12px; } 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -