Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular Material Transparent Toolbar

I'm using angular material on a rails app, want a toolbar to sit on top of an image and make that toolbar clear so you can see the image behind it. Here is the code so far:

<div layout="column" layout-fill>
<div layout="row">
    <img src="http://www.outsideonline.com/sites/default/files/styles/full-page/public/yosemite-smart-black-bear_h.jpg?itok=kKS8ILd9">
    <md-toolbar id="toolbar" class="transparent">
        <div class="md-toolbar-tools">
            <span>Turbo Mortgages</span>
            <!-- fill up the space between left and right area -->
            <span flex></span>
            <md-button ui-sref="app.register"
                       aria-label="Toggle Mobile Navigation">
                About
            </md-button>
            <md-button ui-sref="app.join"
                       aria-label="Toggle Mobile Navigation">
                Join
            </md-button>
            <md-button ui-sref="app.login"
                       aria-label="Toggle Mobile Navigation">
                Login
            </md-button>
        </div>
    </md-toolbar>
</div>
<md-content>
    <ng-view></ng-view>
</md-content>

and what I see on the page right now is just the image...here is the css:

#toolbar {
    position:relative;
    z-index:1000;
}

how do i get the toolbar to lay on top of the image if not with z-index? thanks for help!

like image 335
Adam Weitzman Avatar asked Jul 07 '16 21:07

Adam Weitzman


People also ask

How to change Angular Material toolbar color?

The color of a <mat-toolbar> can be changed by using the color property. By default, toolbars use a neutral background color based on the current theme (light or dark). This can be changed to 'primary' , 'accent' , or 'warn' .

What is Mat toolbar?

The <mat-toolbar> is an Angular Directive used to create a toolbar to show the title, header, or any button action of buttons.

How do I change the height of my mat toolbar?

The height of the toolbar can be changed by adding the classes to the md-toolbar . Save this answer. Show activity on this post.


1 Answers

I ended up making the image the background of the toolbar...You could also set the

position: absolute
background-color:transparent

on the toolbar to place it over the image

like image 155
Adam Weitzman Avatar answered Oct 21 '22 13:10

Adam Weitzman