Hello amazing community,
I'm searching for a neat way to align the text of an element horizontally with that of an Angular Material input field.
Here is the code I am using:
<div style="display: flex">
<div>Greeting: </div>
<mat-form-field>
<input matInput value="world"/>
</mat-form-field>
</div>
After implementation, it looks something like this:
https://i.sstatic.net/qSlK1.png
My goal is to have the text of the div aligned properly. Here's the desired outcome:
https://i.sstatic.net/W2yXy.png
Main inquiry
What steps should I take to align these two elements?
Bonus query
The default alignment seems off. Am I overlooking something here? Is manual alignment the norm or am I missing a simpler solution?
Potentially related concern
This post might offer insights, but the provided code differs significantly from mine, making it challenging to derive a solution.
Thank you in advance,
Wouter