Ask Your Question
3

In Angular, how can a mat cross button be aligned to the right-most position within a div?

asked 2021-09-05 11:00:00 +0000

devzero gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-06-05 09:00:00 +0000

lakamha gravatar image

To align a mat cross button to the right-most position within a div in Angular, you can use the CSS property "justify-content: flex-end" on the parent div. Here is an example:

HTML:

<div class="parent">
  <button mat-icon-button>
    <mat-icon>close</mat-icon>
  </button>
</div>

CSS:

.parent {
  display: flex;
  justify-content: flex-end;
}

This will align the mat cross button to the right-most position within the parent div.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-09-05 11:00:00 +0000

Seen: 11 times

Last updated: Jun 05 '22