There is an element such as a .login__window popup window. It is necessary to make it so that it was not visible, but it appeared when you hover over the button. I don’t want to do through display: none/ visibility: hidden , because transition does not work with it. I do through max-height .
* { box-sizing: border-box; margin: 0; padding: 0; } .login__open { position: absolute; right: 1em; top: 1em; height: 2em; width: 5em; } .login__open:hover ~ .login__window { max-height: 10em; } .login__window { display: table; box-sizing: border-box; background-color: #ebf1ff; border: 1px solid rgba(0, 0, 0, 0.4); border-radius: 1vh 0 1vh 0; margin: 0; position: absolute; display: table; z-index: 100; min-width: 25vw; max-height: 0; //не работает overflow: hidden; padding: 2vh; right: 1em; top: 3em; } .row { display: table-row; margin: 1em; } .row > * { display: table-cell; } <div id="login"> <button class="login__open">Entrer</button> <article class="login__window popup"> <div class="row"> <label for="">Votre login:</label> <input type="text" name="login-login" id="login-login" autocomplete="off" placeholder="Login" /> </div> <div class="row"> <label for="">Votre mot de passe:</label> <input type="password" name="login-password" id="login-password" autocomplete="off" placeholder="password" /> </div> <div class="row"> <button>Entrer</button> </div> </article> </div> So, the .login__window element .login__window not matter at all whether the width is worth it, whether it is worth height , or whether it is worth max-width/height , it does not react to any of these properties.
PS is written in LESS , in CSS converted correctly, there is a height property: 0, and the developer’s tools in chrome also show it. The properties at the top in the comments are given in other parts of the code, and min-width and min-height commented out to check if it works without them. Does not help.