1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

mat-icon does not center in mat-button

Discussão em 'Angular' iniciado por Enrique Metner, Junho 13, 2025.

  1. When I make the font bigger the mat-icon is no longer centered. how can I center the icon inside of the button vertically and horizontally? (Note that the class "mat-icon" is built-in so the css does work specifying the class in the element)

    html:

    <button mat-fab class="add-picture">
    <mat-icon>add_to_photos</mat-icon>
    </button>


    css:

    .add-picture {
    width:100px;
    height:100px;
    }

    .mat-icon {
    font-size: 80px;
    }

    Continue reading...

Compartilhe esta Página