Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1675

Why can I not vertically align a button in a div in Angular?

$
0
0

I have spent way more time on this than any human should, I been through at least 30 solutions on Stack before posting this, as I know it is a VERY common issue. So I apologize for making my own post but I truly cannot get it working.

My code is below:

<div style="width: 100%"><div style="width: 70%; float: left;"><mat-form-field appearance="standard"><mat-label>Filter Table Data</mat-label><input matInput [(ngModel)]="filter" (keyup)="applyFilter($event)"></mat-form-field></div><div style="width: 30%; float: right;"><button          stye="display: flex; flex-direction: column; align-items: center;"          mat-raised-button (click)="clearFilter(1)">          Clear Filter </button></div></div>

This is how it displays on my site:

enter image description here

Any ideas on how I can get it working to be vertically aligned?

End result goal: the button ("Clear Filter") shown in the image needs to be vertically aligned, currently it shows at the top of the div.


Viewing all articles
Browse latest Browse all 1675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>