HTML 100vh does not take care of the browser toolbar on Android

On desktop, if I set the body or a div to be 100vh in order to take all the screen space and let the overflow runs fine, the actual height of the tag is the real visible height of the browser content window.

Instead, on Android (tested with Mozilla Focus 117.0) it does not take care of the browser heading and then the page is not complete.

html {
  height: 100%;

body {
  min-height: 100%;

.content {
  height: 100vh;
<link href="" rel="stylesheet" integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
<script src="" integrity="sha384-HwwvtgBNo3bZJJLYd8oVXjrBZt8cqVSpeBNS5n7C8IVInixGAoxmnlMuBnhbgrkm" crossorigin="anonymous"></script>

  <div class="col-lg-6 mx-auto d-flex flex-column content">
    <div class="container-fluid bg-light px-3 pt-1 flex-shrink-1">
      <p class="text-center display-4 h1">My project</p>
      <hr class="my-1">

    <div class="p-2 flex-grow-1 overflow-scroll">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.
        Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero. Sed dignissim lacinia nunc. Curabitur tortor. Pellentesque nibh.
        Aenean quam. In scelerisque sem at dolor. Maecenas mattis. Sed convallis tristique sem. Proin ut ligula vel nunc egestas porttitor. Morbi lectus risus, iaculis vel, suscipit quis, luctus non, massa. Fusce ac turpis quis ligula lacinia aliquet.
        Mauris ipsum. Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna
        non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. Suspendisse in
        justo eu magna luctus suscipit. Sed lectus. Integer euismod lacus luctus magna. Quisque cursus, metus vitae pharetra auctor, sem massa mattis sem, at interdum magna augue eget diam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices
        posuere cubilia Curae; Morbi lacinia molestie dui. Praesent blandit dolor. Sed non quam. In vel mi sit amet augue congue elementum. Morbi in ipsum sit amet pede facilisis laoreet. Donec lacus nunc, viverra nec, blandit vel, egestas et, augue.
        Vestibulum tincidunt malesuada tellus. Ut ultrices ultrices enim. Curabitur sit amet mauris. Morbi in dui quis est pulvinar ullamcorper. Nulla facilisi. Integer lacinia sollicitudin massa. Cras metus. Sed aliquet risus a tortor. Integer id quam.
        Morbi mi. Quisque nisl felis, venenatis tristique, dignissim in, ultrices sit amet, augue. Proin sodales libero eget ante. Nulla quam. Aenean laoreet. Vestibulum nisi lectus, commodo ac, facilisis ac, ultricies eu, pede. Ut orci risus, accumsan
        porttitor, cursus quis, aliquet eget, justo. Sed pretium blandit orci.

    <div class="px-2 flex-shrink-1">
      <hr class="my-1">
      <div class="input-group">
        <input type="text" class="form-control" placeholder="Placeholder..." aria-label="Placeholder..." aria-describedby="submit">
        <button class="btn btn-outline-secondary" type="submit" id="submit">Send</button>
      <div class="my-1 alert alert-success" role="alert">
        Some messages

    <div class="px-2 flex-shrink-1">
      <div id="carousel" class="carousel slide carousel-fade" data-bs-ride="carousel">
        <div class="carousel-inner">
          <div class="carousel-item active">
            <img src="banner/test1.jpg" class="d-block w-100" alt="SAMPLE BANNER">

Specifically, this happens if the browser hides the toolbar when the user scrolls down the page. For example, the very same code running on my apache webserver leads to the issue I described, but for whatever reason if I run the snippet inside

  1. the browser does not hide the toolbar
  2. the overflow works fine

I guess is possible to tell the browser to keep the toolbar (i.e. this) but it seems a workaround to me.

Is there a way to set the visible height to the real available space with or without the browser toolbar?

It seems a duplicate of this question, but I don’t want to change the browser behavior, I just want to use the available space.

>Solution :

You can use one of the new viewport units that take mobile address bars into account. Probably large or dynamic viewport height (lvh or dvh).

You can find a simple explanation here:

As always you should check browser support before using newer web features, but in this case support is already quite good:

Leave a Reply