The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Hide child element if parents height gets too small
I want to hide the child element if the height of the parent falls below a certain threshold. The height is determined by the text content of the parent. Is there a css-only solution? I am searching for something like this:
parent[height<="60"] child { display: none; }
I made a Pen to illustrate the problem: http://codepen.io/anon/pen/EjVEYV
Can’t you somehow test whether the whole screen is some height, with @media?
@media screen and (max-height: 1660px) /* your 60+ something?*/ { child { display: none; } }
Just a thought, but I’m interested too, if you find a workable solution… Cheers,
Its only achievable by jquery.
if you want the code i can provide it :D