最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

html - I'm trying to create a sticky bottom navigation for mobile using Tailwind CSS and Flex Box, but it isn't

programmeradmin1浏览0评论

As described in the title, I'm simply trying to create a bottom navigation. Here's my code within the body:

...
<body>
<div class="h-screen flex flex-col flex-nowrap overflow-y-hidden">
    <div class="flex-1 flex flex-col justify-center items-center overflow-y-auto">
        <p>Here's my page content.</p>
    </div>
    <div class="flex flex-row gap-2 w-full bg-primary-700 p-2 justify-center">
        <button class="text-gray-300">
            {% include 'icons/database.svg' %}
        </button>
        <button class="text-gray-300">
            {% include 'icons/database.svg' %}
        </button>
        <button class="text-gray-300">
            {% include 'icons/database.svg' %}
        </button>
    </div>
</div>
</body>

On desktop displays, it works fine and the nav shows up at the bottom and the contents of the div with 'flex-1' are scrollable. However, the bottom nav disappears for mobile displays. I'm stumped because as far as I know, this should work on mobile if the same rules work perfectly fine on desktop but I'm not sure what I'm missing. Any help appreciated.

发布评论

评论列表(0)

  1. 暂无评论