change class property depent on div heigh
I have containers in first mode height is >1400px
And in second mod is < 400px
I want to change background color
When toggling height mode
.customClass{ background color:red}
Media query not working
13 Replies
you gotta give us something to be able to help you with. Give this thread a read: https://discord.com/channels/436251713830125568/1022288836715356180
Sorry
We'd need something like a codepen
i create 2 div and class named customclass
i same carde in same div
when heigh of div change i want to change class property
i want to change font of Lizard word when parent of card have height les 450px
Considering you are defining 2 different boxes, you can just define a css var inside the styles of them.
Which would be available to it's children for the font size
I want if parent div change heigh
I want to change color of card
With same class
Like mediaquery
@Kevin i hope thers solution
I want to do it directly with css file
If my idea not clear i will make example
On sandbox
#đź“ťrules Please don't ping people/mods/kevin for questions unless its in direct reply please. If he has time he does read help and will chime in when/if he has time. Thanks
You will need to use JS to check height and change class. When Container Queries come you will be able to use them for a pure CSS solution.
Also a *(working) code example helps fyi.
Sory
There’s no solution
Javascript