How to make this icon easily resizable/responsive in css3? -


i want make following icon in css3 such can width , height of ".circle" (or other wrapper element, point want adjust width , height in 1 place or make automatically fits in container regardless of width , height) without having adjust other css3 properties make "a" line in center.

what best way this? if can recommend better way following appreciated. issue have changing ".circle"'s width , height smaller affects positioning of positioning of eveerything else forcing me change .circle2's properties , .letter's properties until things line up.

css

.circle {     width: 100px;     height: 100px;     background: blue;     -moz-border-radius: 50px;     -webkit-border-radius: 50px;     border-radius: 50px;     cursor:pointer; }      .circle2 {         width:80%;         height:80%;         border-radius: 50px;         position:relative;         top:5%;         left:5%;         border: 5px solid #fff;     }  letter{     position:relative;     top:45%;     left:30%;     margin:auto;     cursor:pointer;     color: #fff;     font-size: 60px;     font-weight: bold;     display: inline-block;     line-height: 0px;  } letter:before {      content: "a" } 

html

<div class="circle">     <div class="circle2">         <a class="letter"></a>     </div> </div> 

have look. thing that's tricky "a" font size. use library http://fittextjs.com/ accomplish fully.

http://jsfiddle.net/csbw3/1/

code bellow , modified.

css3

.container {     width: 100px;     height: 100px;     text-align: center; }  .circle {     width: 100%;     height: 100%;     background: blue;     cursor:pointer;     position: relative;     -moz-border-radius: 50%;     -webkit-border-radius: 50%;     border-radius: 50%; }  .circle:after {     content:"";     display: block;     position: absolute;     /* width: 80%; height: 80%; */     top: 10%; bottom: 10%;     left: 10%; right: 10%;     border: 5px solid #fff;     -moz-border-radius: 50%;     -webkit-border-radius: 50%;     border-radius: 50%; }  .letter {     cursor:pointer;     display: block; } .letter:before {     content: "a";     display: block;     position: absolute;     bottom: 19%;     right: 19%;     font-size: 3em;     font-weight: bold;     color: #fff; } 

html

<div class="container">     <div class="circle">          <a class="letter"></a>     </div> </div> 

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -