I have a div with 70% width, and here’s what i want to do:
- put some words in that div
- adapt font size so that those words occupy all div width
Is this possible with only css? Here is my code:
.parent {
width:70%;
height:auto;
min-height:100px;
background:red;
font-size:10vw;
}
Please help me to change the font-size dynamically to the parent class
<hr>
<div class="parent">
This Text
</div>
Note: the div size is responsive, this is important. Thanks in advance!
Yes but I think you need to use JS(jQuery).
JS:
https://jsfiddle.net/moongod101/sdfaatp8/
Perhaps not quite what you're looking for, but something - You can make both the font and the element relative to view width.
You just have to add
display: inline;
in your codeHere, I Updated it.... JS Fiddel
try to use
css
HTML