Position: fixed, use or not use? Substitutes

1

I recently attended a lecture by Sérgio Lopes , in which he says that NO you should use position fixed in mobile. According to him, this position poses huge problems in the mobile browser, like what happens when zooming in.

However, I'm having a problem right now: I need to put a fixed bar at the bottom of the page, not even that bottom-bar of the design material.

And now, how to do? Use a heavy js to keep her always there? Split into two divs, and put the top one with content and fixed width and overflow, and the bottom one use for the bottom bar?

Or shit for Sergio?

Another thing that is not part of this question: in native apps there is no zoom, so if it is a pwa, which is like-app, why not disable zoom ??

    
asked by anonymous 24.03.2018 / 20:05

2 answers

1

You can change the fixed to position:sticky although browser support is still not very large.

  • Documentation: link
  • Browser support: link (does not work in IE)

And remember that this talk is 2013 !! 5 years in the past!

OBS: IE 7 already accepted position:fixed link

In this response you have some details of the difference between position:sticky and position:fixedhttps #

On Zoom this is a matter of accessibility and limiting the use of it is lousy for those who have vision problems, in addition there are native mobile apps that zoom on the screen qq form ... But I particularly shit for Sergio and would do with Fixed ...

  

A variety of methods allow the user to control content size on mobile   devices with small screens. At the browser level these methods are   generally available to assist a wide audience of users. At the   platform level these methods are available as accessibility features   to serve people with visual impairments or cognitive disabilities.

Here's the official Guide for WCAG 2.0 and W3C / WAI talking about Zoom on mobile devices link

    
24.03.2018 / 21:57
2

Dude, really the 2013 talk is already pretty outdated. Do not shit at me, but you can shit for the talk hahaha.

The scenario was very chaotic in 2013. Nothing worked with fixed in virtually any browser. Things have improved a lot since then .

But they remain somewhat chaotic.

The best reference about fixed on mobile that you find today is the most detailed tests of @ppk :

link

Note that many modern browsers already support fixed with certain security. But there are the old ones, and there are other types of browsers. I recommend looking over there to understand the current limitations, and for you to decide which browsers you want to support.

On the zoom, I still advocate that sites do not zoom out. It is a matter of accessibility. Native apps do not really allow zooming; This is a bug. I'm glad that on the Web we can be better than them :-P

    
26.03.2018 / 19:55