Tips on personalizing Materialize modal components

I am struggling to get the modal to appear on the right side of the screen with a specific width and height. However, it seems to be displaying differently on different screen sizes.

For instance, on small screens, only half of the modal is visible while on larger screens, it only takes up three-quarters of the space.

Below is my HTML code for the modal:

div#myModal.modal.open {
  display: block;
  opacity: 1;
  transform: scaleX(1);
  top: 13vh !important;
  left: 129vh;
  width: 58vh;
  background-color: #37373b !important;
  height: 100%;
}
<div id="myModal" class="valign-wrapper modal modalHeight" style="height:100%; overflow-x:hidden;">
  <div class="modal-content right">
    <div class="modal-header">
      <h4 class="modal-title" id="myModalLabel">Approval Form</h4>
      <button class="modal-close close dashboardClose" data-dismiss="modal" onclick="close()" aria-label="Close"><span aria-hidden="false">&times;</span></button>
    </div>
    <div class="modal-body modalHeight">
    </div>
  </div>

Answer №1

Specify the percentage values for top, left, width, and height in my code. The following adjustments proved effective for me

div#myModal.modal.open {
  display: block;
  opacity: 1;
  transform: scaleX(1);
  top: 25% !important;
   left: 80% !important;
  width: 40% !important;
  background-color: #555555 !important;
  height: 120%;
}

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

switching tabs on a webpage

My PHP page has a menu tab with tabs labeled as Dash and Project. The Dash tab contains a table displaying data. The scenario is that when I click on a row in the table within the Dash tab, it should navigate to the Project tab, where a simple form is disp ...

Chrome Extension for Extracting Data from Websites

I am in the process of developing my Google Chrome extension that needs to store a variable from another website by passing it over. Below is the snippet of code found in the script.js file of the website: var editorExtensionId = "extension"; & ...

When I use the readfile function to display content on my page, it automatically indents the

I am experiencing an issue where the first line of text is indented when I use readfile in php on my page. Is there a simple solution to fix this problem or is it something that must be addressed with more complex measures? Below you can see a snippet of ...

How can I retrieve the selected value from an Angular 2 dropdown menu when it changes, in order to utilize it within a function?

I am currently working on creating a dropdown menu with multiple options. When a user selects an option, I need to make an API call that requires an ID parameter. Inside my component.ts file, I have defined an array containing the values like this: valu ...

Ways to display a GIF image as a pop-up during data loading in an MVC application

I am working on a project using the MVC framework. The application retrieves a large amount of data during loading. I would like to display a loading image - a .gif file while fetching records. Below is the code snippet I am currently using: //Loads rec ...

Facing problems with the directory!

I'm experiencing some trouble with directory paths. Let's say I have a file located in the following directory: public_html/v3/index.php And from there, I want to access this file: public_html/navigation/sideLogIn.php I've tried using t ...

Styling your div elements in CSS to shrink in width relative to their parent container

.container { max-width: 750px; height: 100px; background-color: red; margin: 0; padding: 0; } .box1 { width: 100px; height: 100%; float: left; background-color: black; } .box2 { width: 650px; height: 100%; fl ...

The issue of Angular 6 view failing to display accurate data upon page load

In my Angular 6 application, I've implemented a login feature using Firebase's Google login. The interface includes a button labeled Login when the user is logged out, and changes to Logout with the current email address displayed when the user i ...

Trouble with z-index property within the confines of the <ion-segment-button></ion-segment-button> tag

The z-index property seems to be having no effect on the elements within the ion-segment-button. I attempted to adjust the positions of the elements and set the z-index to 999999 with the button z-index set to -1. However, this solution did not work as ex ...

Upon returning to the website homepage from another page, the JavaScript animation ceases

I implemented a unique typewriter animation on my homepage by utilizing code from this source and making minor HTML edits to customize the content. https://codepen.io/hi-im-si/pen/DHoup. <h5> <body>Hello! I am Jane.</body> < ...

What is the reason behind Drupal 8 appending a GET variable to the end of each CSS file and resulting in a 404 error?

I've been struggling for hours trying to figure out why the CSS is not loading on the Drupal 8 site I'm migrating. Despite successfully resolving other issues, the CSS files are throwing a 404 error, specifically due to a GET variable (?oe62rp) a ...

Creating an interactive TABLE with twitching animations in a straightforward HTML and JavaScript project

Currently, I am tackling a JavaScript challenge involving placing eight queens on a chessboard in such a way that they do not attack each other. However, there seems to be an issue - whenever I place a queen in an unoccupied column, that particular column ...

Leverage a single property from a CSS class within another CSS class

I am facing an issue where I need to utilize one property from a CSS class in another CSS class. .class_a {margin:10px; width: 360px; float: left; color:#ffffff; ...etc...} .class_b { use the margin property of .class_a } Only utilize the margin propert ...

Angular Error: Why is the book object (_co.book) null?

The following error is displayed on the console: ERROR TypeError: "_co.book is null" View_SingleBookComponent_0 SingleBookComponent.html:3 Angular 24 RxJS 5 Angular 11 SingleBookComponent.html:3:4 ERROR CONTEXT {…} ​ elDef: ...

Update the background color on the sidebar

Objective: I want to change the background of the class="col-sm-3 blog-sidebar" to match the color shown in the image below. Essentially, I am looking to update the sidebar background to reflect the picture's color. Challenge: How can this be ach ...

The layout designed with CSS Grid features two static sidebars, but unfortunately, the main content is not aligning

After deciding to experiment with CSS-grid, I encountered a frustrating roadblock. My goal was to create two fixed navigation bars on the left and right sides, with the main content in the center that would be scrollable. <div class="grid"> < ...

Scaling images proportionally using CSS (without the need for JavaScript, ideally!)

Is there a way to proportionally scale images using CSS? I'm looking for a solution where the image adjusts to the full container size, becoming larger or smaller based on the container dimensions. Additionally, I want the image to be displayed in th ...

Exploring new ways to customize Nebular styles within an nb-user tag

I've been struggling to adjust the font-weight and border-radius of a nb-user tag without any luck. I attempted to add a class and make changes in the .scss file, but nothing seemed to work This is the HTML <div class="teachers-box" *ngF ...

After submitting my form, the value of `$_POST['submit']` was not set

Just starting out with php and attempting to add a user to a database through a form. Utilizing the bootstrap framework, here is the code for the form: <form class="form-horizontal" role="form" method="POST" action="connectivity-reserve.php"> ...

Is there a way to accurately retrieve the width of an element within setInterval without any delay?

I'm currently experimenting with increasing a progress bar using the setInterval function. So far, it seems to be functioning properly. var progressBar = $('.progress-bar'); var count = 0; var interval = setInterval(function () { va ...