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•3y 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@HeROP•3y ago
Sorry
croganm
croganm•3y ago
We'd need something like a codepen
M@HeR
M@HeROP•3y 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@HeROP•3y ago
M@HeR
M@HeROP•3y ago
M@HeR
M@HeROP•3y ago
i want to change font of Lizard word when parent of card have height les 450px
Coder_Carl
Coder_Carl•3y 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@HeROP•3y 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•3y 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@HeROP•3y ago
Sory There’s no solution
croganm
croganm•3y ago
Javascript
Want results from more Discord servers?
Add your server