I have div that opens to the side when I click the button:
IfIleavethedivwith"Change city" with fixed height until it resolves, but the letters continue to move.
Would there be any way the elements would not resize when opening?
In the div that contains the animation place:
div{
overflow:hidden;
white-space:nowrap;
}
This will make whatever is inside your div is the size of it, without resizing.
A fixed element - fixed - is positioned relative to the "viewport", which means that it will always stay in the same place even if there is scrolling on the page.
As with relative, the properties top
, right
, bottom
, and left
are also used.
I'm sure you noticed a fixed element in the right corner of the screen, I'm giving you the permission to look at it now, and here's the CSS applied to it:
.fixed {
position: fixed;
bottom: 0;
right: 0;
width: 200px;
background-color: white;
}
<div class="fixed">
Oi! eu estou fixo
</div>