Leave div and fixed elements

1

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?

    
asked by anonymous 08.07.2017 / 19:01

2 answers

1

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.

    
08.07.2017 / 21:26
1

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>
    
08.07.2017 / 20:33