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
Jochem
Jochem•2y ago
you gotta give us something to be able to help you with. Give this thread a read: https://discord.com/channels/436251713830125568/1022288836715356180
M@HeR
M@HeR•2y ago
Sorry
croganm
croganm•2y ago
We'd need something like a codepen
M@HeR
M@HeR•2y ago
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
M@HeR
M@HeR•2y ago
M@HeR
M@HeR•2y ago
M@HeR
M@HeR•2y ago
i want to change font of Lizard word when parent of card have height les 450px
Coder_Carl
Coder_Carl•2y ago
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
M@HeR
M@HeR•2y ago
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
b1mind
b1mind•2y ago
#đź“ť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.
M@HeR
M@HeR•2y ago
Sory There’s no solution
croganm
croganm•2y ago
Javascript