display: none
and visibility: hidden
.hidden
, then it should smoothly dissolve and completely get out of the stream. It is quite normal behavior, which is already present in many JS-libraries. div { display:block; } div.hidden { display:none; animation: slide-out 1s 1; }
display:none
property is specified, there will be no animation. Well right, who needs animation for hidden objects? @keyframes slide-out { 0% { display:block; opacity: 1; } 100% { display:none; opacity:0; } }
display:none
rule in div.hidden
will work. If there is animation support, then at the beginning of the animation the value of the property as a block
will be returned to the block
, the opacity property will be iterated, and at the end the block will be hidden.transparent
keyword was proposed so that you can write it like this: linear-gradient(red, transparent, blue);
linear-gradient(red, rgba(255,0,0,0) 50%, rgba(0,0,255,0) 50%, blue);
window
and document
'a events. In the first case, the behavior remains as the prediction, the click coordinates are relative to the window, and in the second case, they are taken in relative coordinates of the element. This edge is necessary for the further development of these modules, otherwise for calculating the coordinates, it will be necessary to constantly apply complex calculations on JavaScript.Source: https://habr.com/ru/post/125297/
All Articles