1
I’m having to develop some views, and frankly define my knowledge of CSS as structural.
I wonder if it is possible to create a method, without using Javascript, to set the font size to be used in the text dynamically.
Example:
<div class="text-20"> <!-- font-size : 20px; -->
</div>
<div class="text-25"> <!-- font-size : 25px; -->
</div>
<div class="text-15"> <!-- font-size : 15px; -->
</div>
I mean, basically the class
would be .text
and the -{num}
corresponding to the font size.
Do you want it to work with any value, without setting the classes manually? It doesn’t. But you can generate CSS for a certain range of values. Or use steps that make sense in website design.
– bfavaretto
I understand, yes my intention was for any value, thank you the help, I will do by javascript even.
– Guilherme Lautert
Why don’t you just use the inline style? <div style="font-size:20px"</div>?
– ndvo