1

How can I ignore bottom property on mobile screens?

<div id="myID">...</div>

#myID {
  position: fixed;
  bottom: 5px;
  right: 5px;
  opacity: 1;
  cursor: pointer;
}
@media (min-width:305px) and (max-width:415px) {
  #myID {
    top: 8px !important;
    right: 225px !important;
    zoom: 0.6 !important;
    z-index: 99999999 !important;
  }
}

It tries to take bottom:5px and top:8px at the same time, and it causes some problems on mobile screens.

Stickers
  • 75,527
  • 23
  • 147
  • 186
Mert
  • 33
  • 6

1 Answers1

0

You can reset bottom to the initial value auto, e.g.

@media (min-width:305px) and (max-width:415px) {
  bottom: auto;
  ...
}

By the way, you can remove all the !important declaration in your example. In fact it's highly recommended to do so, read this post to learn more.

Community
  • 1
  • 1
Stickers
  • 75,527
  • 23
  • 147
  • 186