I have a block with fixed height:
div {
font-size: 16px;
}
<div class="card" height="200px">
text...
</div>
How to resize text if it does not fit in div by height?
I have a block with fixed height:
div {
font-size: 16px;
}
<div class="card" height="200px">
text...
</div>
How to resize text if it does not fit in div by height?
using the javaScript
<div id = "theId" class="card" height="200px">
text...
</div>
<script>
let theNewHeight = "16px"
document.getElementById("theId").style.height = theNewHeight;
</script>
or set the value in css to % instead of px
div {
font-size: 16%;
}
that 'll change it depending on the size of document, witch means 16% of the document.