Reputation: 25
I have a div which is responsive but text content is not responsive it is not decreasing as the width change.
HTML
<div class="circle">Hello I want to resize.</div>
CSS
.circle
{
width:100%;
height:100%;
border-radius:250px;
font-size:200%;
color:#fff;
text-align:center;
background:#000
}
Upvotes: 1
Views: 568
Reputation: 7701
You can use viewport value instead of ems, pxs or pts.
1vw = 1% of viewport width
1vh = 1% of viewport height
1vmin = 1vw or 1vh, whichever is smaller
1vmax = 1vw or 1vh, whichever is larger
Try font-size:7vw;
.
.circle
{
width:100%;
height:100%;
border-radius:250px;
font-size:7vw; //changed this
color:#fff;
text-align:center;
background:#000
}
Upvotes: 2