Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to align title and button on the same line?

I have a title and a button. The title should be left-aligned and the button should be right-aligned. But I have a problem that the button goes up.

How to align title and button on the same line?

.page-header {
  margin: -16px -16px 16px;
  padding: 16px;
  color: $white;
  background-color: $red;
}
<header class="page-header">
  <h1>{{title }}</h1>
  <span fxFlex></span>
  <button mat-icon-button>
            <mat-icon>navigate_before</mat-icon>
        </button>
</header>

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Add this CSS on page-header class:

 .page-header {
   ...;
   display: flex;
   justify-content: space-between;
   align-items: center;
 }
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading