Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72531

Why will height not change for specific mat-form-field? (Angular 6)

$
0
0

Goal: Make the height of a particular mat-form-field smaller (but still keep it positioned where it is, to the right of "Please Sign In"). It should take the minimum amount of space around the text value and dropdown arrow.

It currently looks like this:

Width

I want the lines on the box around it to be closer to the word English and the down arrow. The box was created by adding: appearance="outline"

Problem: I was able to successfully change the width, but not the height.

What I've tried:

HTML:

<div class="title-container">
    <mat-card-title class="text-center" i18n="@@MoVeSeLo_H1_1">
        Please Sign In
    </mat-card-title>
    <form [formGroup]="_siteForm">
        <mat-form-field class="language-field" appearance="outline">
            <mat-select (selectionChange)="doSomething($event)" [value]="languages[i]">
                <mat-option *ngFor="let language of languages" [value]="language">
                    {{language.viewValue}}
                </mat-option>
            </mat-select>
        </mat-form-field>
    </form>
</div>

CSS:

.title-container {
    position: relative;
    margin-top: 8px;
}

.language-field {
    position: absolute;
    right: 0;
    top: 0;
    margin-top: -16px;
    width: 115px;
    height:40px;
    padding-top: -1.84375em;    
}

Viewing all articles
Browse latest Browse all 72531

Trending Articles



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