2
How do I get the CSS display property to switch from None to flex with a 1s delay without using Javascript for this?
I have the following code:
#botao-painel:checked ~ .painel {
display: flex;
height: 100%;
left: 0;
top: 0;
width: 100%;
}
.painel {
align-items: center;
background-color: RGBA(0,0,0,0.85);
display: none;
height: 0;
justify-content: center;
left: 50%;
position: fixed;
top: 50%;
transition: all 1000ms ease 2000ms;
-webkit-transition: all 1000ms ease 2000ms;
width: 0;
z-index: 500;
}
.painel > div {
align-items: center;
background-color: RGB(255,255,255);
display: flex;
height: 75%;
justify-content: center;
width: 46%;
}
The problem is that when I click the button it applies the properties in . but the delay and not even the animation are used, simply everything appears at once.
Does anyone have any tips to give me how to solve this without using Javascript, only with CSS?
You want to make the transition from property
display
, that’s it?– fernandosavio
No, I want the size transition to start after the display has been changed to flex.
– Allan Max