Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resize mat-raised-button

Tags:

html

css

I am trying to reduce the size of mat-raised button. I thought I can reduce the size of the button by reducing the size of the text. But I'm unable to do so.

Here is the CSS:

button {
    margin-right: 1vw;
    background: #4285F4;
    color: white;
    font-size: 9px;
    height: auto;
    width: auto;
}

And the template:

<button mat-raised-button class="button"><span>Click here to submit</span></button>
like image 791
rock11 Avatar asked Aug 02 '19 15:08

rock11


People also ask

How do I change the height on my mat button toggle?

You can change the height by adding custom styles. You have to change the line-height of the class mat-button-toggle-label-content . Save this answer.


1 Answers

You're on the right track. In addition to font-size you also need to change line-height:

button{
    margin-right: 1vw;
    background: #4285F4;
    color: white;
    font-size: 9px;
    line-height: 18px;
    height: auto;
    width: auto;
}

https://stackblitz.com/edit/angular-fmgfn1

like image 164
J. S. Avatar answered Sep 25 '22 08:09

J. S.