Skip to content

Instantly share code, notes, and snippets.

@fredgrott
Created February 13, 2018 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fredgrott/0c386ff3b13eed15dca0cc841aba6ac0 to your computer and use it in GitHub Desktop.
Save fredgrott/0c386ff3b13eed15dca0cc841aba6ac0 to your computer and use it in GitHub Desktop.
the notch adjustment in web code

Notch Adjustment

html

   <head>
   <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover">
   </head>
   

css

   @supports(padding: max(0px)){
   body{
     padding: env(safe-area-insert-top) env(safe-area-insert-right) env(safe-area-insert-left) env(safe-insert-bottom);
   }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment