Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bulma navbar overlaps main section

Tags:

html

css

bulma

I'm trying to figure out to use Bulma's fixed navbar on top covering 10%, a main section covering 80% and a navbar at the bottom covering another 10%. The navbars have icons and text. Without setting the heights there is already some deviance and by setting the heights the deviance seems to be a little less, however the containers are still not aligned.

<!DOCTYPE html>
<html class="" lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.4/css/bulma.min.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
</head>

<body class="has-navbar-fixed-top has-navbar-fixed-bottom">
    <header>
        <nav class="navbar is-fixed-top message-header has-background-warning">
            <a>
                <span class="icon is-large"><i class="fas fa-users fa-3x"></i></span>
                <span>Members</span>
            </a>
            <a>
                <span class="icon is-large"><i class="far fa-images fa-3x"></i></span>
                <span>Photos</span>
            </a>
            <a>
                <span class="icon is-large"><i class="fas fa-map-marked-alt fa-3x"></i></span>
                <span>Maps</span>
            </a>
            <a>
                <span class="icon is-large"><i class="fas fa-calendar-alt fa-3x">    </i></span>
            <span>Calendar</span>
            </a>
        </nav>
    </header>

    <section class="eightyvh has-background-primary">
        <div class="container">Why is this text behind the navbar?</div>
    </section>
    <footer>
        <nav class="navbar is-fixed-bottom message-header has-background-warning">
            <a>
                <span class="icon is-large"><i class="fas fa-users fa-3x"></i></span>
                <span>Members</span>
            </a>
            <a>
                <span class="icon is-large"><i class="far fa-images fa-3x"></i></span>
                <span>Photos</span>
            </a>
            <a>
                <span class="icon is-large"><i class="fas fa-map-marked-alt fa-3x"></i></span>
                <span>Maps</span>
            </a>
            <a>
                <span class="icon is-large"><i class="fas fa-calendar-alt fa-3x">    </i></span>
            <span>Calendar</span>
            </a>
        </nav>
    </footer>
</body>
</html>
like image 320
Sasha Avatar asked Feb 26 '19 14:02

Sasha


People also ask

Why is my navbar covering next section container?

It is because the nav bar is fixed.

What is navbar fixed top?

A fixed navigation bar, also referred to as a “sticky” navigation bar, is a toolbar that stays in place while the user is scrolling the web page.


1 Answers

HTML

<section class="section">
 <nav class="navbar is-fixed-top" role="navigation">
 ...
 </nav>
</section>

if you use is-fixed-top, enclose nav in section

like image 162
Selpano Avatar answered Oct 18 '22 13:10

Selpano