Leave div and fixed elements

Asked

Viewed 832 times

0

I have div that opens to the side by clicking the button:

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

If I let the div with "Change City" with fixed height will solve, but the letters keep moving.

Would it have some way that the elements would not resize when opening?

  • How do you keep moving ?

2 answers

0

A fixed element - Fixed - is positioned relative to the "viewport", it means that it will always be in the same place even if there is scrolling on the page.
As well as relative, 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 permission to observe 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>

0


In div q contains the place animation:

div{
   overflow:hidden;
   white-space:nowrap;
}

This will make whatever is inside your div the size of it, without resizing.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.