Show an Angular Mat Card beneath the Input Field and position it on top of all other div elements

I am designing a signup page and I need to include a material card below the password field with checkboxes for password requirements.

The challenge is that when the card appears, it pushes down all other elements such as the sign-up button. I want the card to float on top without affecting the layout of other content.

HTML:-

<div class="sign-in-box row">
  <div class="row">
    <div class="sign-in-text">Sign Up</div>
  </div>
  <!-- input form -->
  <form [formGroup]="loginForm" (ngSubmit)="onSubmit()">
    <div>
      <!-- Name Name -->
      <div class="input-field row">
        <div class="col">
          <mat-form-field appearance="outline">
            <mat-label>First Name</mat-label>
            <input matInput formControlName="fName" required />
          </mat-form-field>
        </div>

        <div class="col">
          <mat-form-field appearance="outline">
            <mat-label>Last Name</mat-label>
            <input matInput formControlName="lName" required />
          </mat-form-field>
        </div>
      </div>

      <!-- email -->
      <div class="input-field">
        <mat-form-field appearance="outline">
          <mat-label>Email Address</mat-label>
          <input matInput formControlName="email" required />
        </mat-form-field>
      </div>

      <!-- password -->
      <div>
        <mat-form-field appearance="outline">
          <mat-label>Password </mat-label>
          <input
            matInput
            [type]="hidePassword ? 'password' : 'text'"
            (focus)="onFocusChange()"
            (blur)="onFocusChange()"
            formControlName="password"
            required
          />
        </mat-form-field>
      </div>
      <!-- Password hints -->
      <div *ngIf="showPasswordDetails" class="on-top">
        <mat-card>
          <mat-card-header>
            <mat-card-title>Password Requirements</mat-card-title>
          </mat-card-header>
          <div>
            <mat-card-content>
              Password must contain 8 characters <br />
              Password must contain Upper Case Character <br />
              Password must contain Lower Case Character<br />
              Password must contain Number <br />
            </mat-card-content>
          </div>
          <mat-card-actions>
            <button mat-button>LIKE</button>
            <button mat-button>SHARE</button>
          </mat-card-actions>
        </mat-card>
      </div>
    </div>

    <!-- remember me box -->
    <mat-checkbox >Remember Me</mat-checkbox>

    <!-- Sign In Button -->
    <div class="sign-in-container">
      <button mat-raised-button color="primary">
        Sign In
      </button>
    </div>
  </form>

  <!-- forgot password and signup -->
  <div class="forgot-password-signup">
    <a href="">Forgot Password?</a>
    <a href="">Dont Have an Account? Sign Up</a>
  </div>
</div>

SCSS:-

.sign-in-box {
  margin: 5% 10%;
  height: 75%;
  width: 80%;
  display: flex;
  flex-wrap: nowrap;
  flex-direction: column;
}

.icon-background {
  margin: auto;
  background-color: #f48fb1;
  padding: 0;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  align-items: center;
  display: flex;
}

.icon-row {
  padding: 10px;
}

.sign-in-text {
  width: fit-content;
  margin: auto;
  font-size: 1.5em;
}

.input-field {
  width: inherit;
  margin: 5% 0;
}

.sign-in-container {
  margin: 5% 0 0 0;
}

.forgot-password-signup {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
}

.on-top {
  z-index: 100;
}

.width--inherit {
  width: inherit;
}

If you are facing issues with the positioning of the card, you can refer to this Stackblitz demo https://stackblitz.com/edit/angular-9-material-starter-wk73w3.io for assistance. Just enter the first name and last name, and notice how the password field affects the layout when clicked on.

Your cooperation is highly appreciated.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Angular - Enhance User Experience with Persistent Autocomplete Suggestions Displayed

Is there a way to keep the autocomplete panel constantly enabled without needing to specifically focus on the input field? I attempted to set autofocus on the input, but found it to be clunky and the panel could still disappear if I hit escape. I also ...

What is the best way to automatically close a modal box after submitting a form?

Currently, I am utilizing the CSS modal box developed by Paul R. Hayes. More information about this can be found here - Within the modal box, I have integrated a form. This form is aimed at an iframe that remains concealed on the same page. My objective i ...

Parallax Effect Slows Down When Scrolling In Web Page

Currently in the process of creating a website with a scrolling parallax effect using Stellar.js on the header and three other sections. However, I'm experiencing lag when scrolling, especially at the top of the page. I've attempted to reduce la ...

Remove the <select> highlight specifically for Internet Explorer

Looking for a way to remove the blue highlight in Internet Explorer. I am working with a select tag and whenever an option is chosen from the dropbox, the blue highlight shows up. Unfortunately, I don't have access to IE on my Mac so I can't test ...

There was a lack of dynamic content on the webpage when using the view/template engine (Handlebars)

I'm currently using the Handlebars template engine in my project. Despite not encountering any errors in the console, I'm facing an issue with displaying dynamic content in the index.hbs file that is rendered from app.js. app.js const express = ...

Stopping CSS animations at a specific point along the path without using timing functions can be achieved by implementing a targeted

Is there a way to pause an animation at the 50% mark for 2 seconds and then resume? P.S. The setInterval method is not recommended! function pauseAnimation() { document.getElementById("0").style.animationPlayState = "paused"; }; var pauseInterval = set ...

Choose and manipulate a set of elements using Jquery

Below is a piece of code I have: <div class="timeline"> <div class="timeslice" data-tid="360"></div> <div class="timeslice" data-tid="360"></div> <div class="timeslice" data-tid="360"></div> <di ...

Yeoman webapp error: Issue with incorrect CSS path in subfolder

I have been using the yeoman webapp generator (0.5.0) and my app directory is structured like this: app/ ├── dir1 │ └── index.html ├── favicon.ico ├── images ├── index.html ├── robots.txt ├── scripts │ └ ...

I'm looking to input user data into a table using a unique ID, but the console is alerting me with a "Warning: Each child in a list should have a unique 'key' prop." notification

Here's my custom Add User React component: import axios from "axios"; import { useState } from "react"; const CustomAddUserComponent: React.FC<{ fetchUserData: () => void }> = ({ fetchUserData, }) => { const [name, setName] = useState ...

Guide on validating an Australian phone number with the HTML pattern

When it comes to PHP, I have found it quite simple to validate Australian phone numbers from input using PHP Regex. Here is the regex pattern I am currently using: /^\({0,1}((0|\+61)(2|4|3|7|8)){0,1}\){0,1}(\ |-){0,1}[0-9]{2}(\ | ...

Ways to slightly boost the default font-size values when using wicked-pdf

In the wicked-pdf report, I have body content with varying font sizes. When I apply a font-size of 16px to the paragraph like so: p { font-size: 16px !important; } The entire paragraph's font size becomes 16px, which may include words with diff ...

What is the process for configuring environmental variables within my client-side code?

Is there a reliable method to set a different key based on whether we are in development or production environments when working with client-side programs that lack an inherent runtime environment? Appreciate any suggestions! ...

making the div tag invisible when the if statement is satisfied

Is there a way to hide a <div> element if my data equals zero? I have an if condition set up as follows: if ($_SESSION['m1'] == 0) { I want the <div> tag to be deactivated, here is the code snippet for the <div> in question: ...

Is it possible to transfer the style object from PaperProps to makeStyles in Material UI?

I am working with a Material UI Menu component and attempting to customize its border. Currently, I am only able to achieve this customization by using PaperProps inline on the Menu element. However, I already have a makeStyles object defined. Is there a ...

Displaying a dynamic flag icon in a span element based on the selection from a mat-select

I am working on a mat-select component and I want to dynamically change a flag icon inside a span element in the mat-label based on the selected option. Currently, the initial flag is displayed correctly, but when I click on a different option, the flag d ...

Establishing default parameters for angular pipes

Is there a way to establish default settings for an angular pipe without creating a custom one myself? I frequently utilize the currency pipe in this manner {{ price | currency:'EUR':'symbol':'0.2-2':'de' }} I&apo ...

Angular CodeMirror Line-Break function not displaying line numbers

I am currently utilizing Code Mirror from ngx-codemirror. My goal is to split the line when it fits within the width of the parent container. After searching, I found a couple of solutions that suggest using: lineWrapping: true Additionally, in the styles ...

Unable to import global CSS in React; however, local components are working fine

My React application is having trouble loading global CSS styles. While local components are able to access their own styled-components, the global CSS styles are not being applied across all components. I have tried various import paths and different file ...

Having trouble updating Angular-Datatables in Angular 17: Issues with Re-rendering the DataTable

Currently immersed in the development of an Angular 17 application that utilizes Angular-Datatables. I am facing difficulties in re-rendering the DataTable upon updating data post a search operation. Delve into the snippet below, which showcases the pertin ...

How can I ensure text remains confined within the parent div when working with Bootstrap?

I'm having trouble keeping the text and links within their parent div. Even though I set the outer boundary as col-sm-8, the text and links are overflowing. I'm not sure what I'm doing wrong, but the code I am using is shown below. I have a ...