I am trying to fit a single character font-size to its parent div. is it possible?
Maybe it's a Font scaling based on width of container by @Francesca duplicate?
But my context is a Single Character so maybe it is possible but font can be normal font-family or iconic font like font-awesome.
I appreciate a fiddle work
body {
font-size: 10px;
font-family: Arial
}
.box1 {
border: 1px solid red;
margin: 10px;
width: 50px;
height: 50px;
font-size: 4vw;
}
.box2 {
border: 1px solid blue;
margin: 10px;
width: 200px;
height: 200px;
font-size: calc(3vw + 3vh);
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="box1">x</div>
<button class="box1">x</button>
<div class="box2"><i class="fa fa-remove"></i></div>
<button class="box2"><i class="fa fa-remove"></i></button>