Angular 2 Material 2 Top Navigation Bar \ Toolbar

I have a toolbar, but it leaves a space instead of a smooth one at the top of the page.

I would also like it to be sticky, but not yet working on this part, since it doesn't look like my toolbar implementation is a “header”. What am I doing wrong or using the wrong component?

Toolbar with spaces

<md-toolbar color="primary">
    <i class="material-icons app-toolbar-menu">menu</i>
    <span class="app-toolbar-filler"></span>
    <md-sidenav>
    </md-sidenav>
</md-toolbar>
+4
source share
2 answers

Accepted another answer seems to be hacked as your toolbar is not really sitting. Here is the best way to do this.

In styles.cssinstall:

body {
    margin: 0;
}

HTML. , HTML <div> .

+6

md-sidenav-container fullscreen:

<md-sidenav-container fullscreen>
    <md-toolbar color="primary">
        <i class="material-icons app-toolbar-menu">menu</i>
        <span class="app-toolbar-filler"></span>
        <md-sidenav>
        </md-sidenav>
    </md-toolbar>
</md-sidenav-container>

-

:. . .

+2

Source: https://habr.com/ru/post/1676584/


All Articles