Container size is not accommodating elements

Currently in the process of developing a login page and utilizing @media for improved CSS layout on mobile devices. https://i.sstatic.net/LM8q8.png. The issue is that despite implementing @media rules, the inputs and buttons are not extending to the full width of the container. Any suggestions on how to ensure that the inputs and buttons occupy the entire space available within the container?

Provided below is some relevant code snippets for reference. Appreciate any insights you may offer!

CSS and HTML:

@media (max-width:500px) {
  input {
    height: 40px;
    width: 100%;
    display: block;
    border-radius: 0px;
    border-top: 0px;
    border-left: 0px;
    border-right: 0px;
  }
  login-box {
    width: 90vw;
    border: 0px solid #000000;
    display: grid;
  }
  login-button {
    width: 100%;
    display: block;
  }
  login-box-content {
    display: grid;
  }
}
<body>
  <all>
    <login-wrapper>
      <login-box>
        <login-box-content>
          <login-title>Login</login-title>
          <login-input>
            <login-label>Username</login-label>
            <Br>
            <input></input>
          </login-input><br>
          <login-input>
            <login-label>Password</login-label>
            <Br>
            <input></input>
          </login-input>
          <login-button onclick="pressed()">
            <login-button-content>Login</login-button-content>
          </login-button>
        </login-box-content>
      </login-box>
    </login-wrapper>
  </all>
  <script src="script.js"></script>
</body>

Answer №1

I feel foolish...

The solution is: The media section should come after the current css in order to effectively override the existing css styles!

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

What could be causing the malfunction of BS4 Scrollspy?

I'm having trouble with implementing Bootstrap 4's Scrollspy feature. Despite going through the BS4 documentation and watching a Scrollspy tutorial on YouTube, I still can't seem to get it to work properly. Currently, I am using a CDN for BS ...

Is there a way to arrange the outcomes in a single line?

I need help displaying my results in three rows side by side in React/JavaScript using flexbox. Since I only have one CardItem, I can't just copy and paste it three times as it would show the same result in each row. Is there a way to achieve this wit ...

Playing with background hues

Can anyone help me with this issue? I've been attempting to change the background color using jQuery upon document load, but it doesn't seem to be working. Any thoughts on what I might be doing wrong? http://jsfiddle.net/KczZd/2/ HTML: <d ...

The SimpleHTTPServer is causing Google Maps Places Autocomplete feature to malfunction

Currently, I am implementing a location search feature along with form auto-fill using the google.maps.places.Autocomplete functionality. While accessing the HTML file directly (file:///location.html), everything is functioning as expected. However, when ...

How can Node.js and Express be used to conceal Javascript code on the backend?

I'm a beginner when it comes to Node and Express. I have a query regarding how to securely hide Javascript code on the backend. Currently, I am working with Node.js and Express. My goal is to prevent users from easily accessing the code through browse ...

What is the best way to access the child DOM of a Vue element?

Is there a way to access the child DOM element of a Vue component? In the code snippet below, I am trying to retrieve the <input> element nested within the <div>. var vm = new Vue({ el: '#box', data: { pick: true, a: & ...

Implementing unique functionalities based on whether the link is clicked an odd or even number of times

Three student names are listed as links. When a link is clicked for the first time or odd number of times, a div containing details about that student appears. Clicking the same link for the second time or even number of times hides the student div. This f ...

Highlight the phrase "figure x" within the paragraph to emphasize its importance

I want to emphasize figure 1, figure2, ...all the way up to figure 111. I am limited to making changes in HTML and CSS only, without using JavaScript or jQuery. Is there a different method than just inserting <strong> in the HTML? In CSS, we have : ...

How to position a div in the center on top of a full-width slideshow using CSS

I am facing a challenge with positioning the banner slideshow controls div in the middle of the screen on top of a full-width slideshow. The main container's width is set to 100%, which is causing issues with centering the controls div. I have attemp ...

Ways to ensure the menu remains fixed on a fluid website

Is there a way to prevent the main-menu from moving to a second line when resizing the page down, while still maintaining fluidity? Thank you, Ken ...

Increase the size of an image when the mouse hovers over it within a

Recently, I came across this tutorial on creating a zoom in effect for images when hovering over them with the mouse. The tutorial doesn't use tables to display the images, so I was wondering if I could achieve the same effect by placing the images in ...

Set the button to align on the left side within a Bootstrap card

Creating grid elements in Bootstrap 3, I am faced with a challenge. When the viewport is below <768px, I want to align a button in the same position as shown in the image with the lion. Check out the demo site here. For viewports >768px, the button ...

Tips for displaying a multi-select dropdown in the Creative Tim Angular Material Pro filter panel

I am in need of assistance with modifying the standard Creative Tim Angular Pro Material template due to my limited CSS/SCSS skills. Could someone provide examples of the necessary changes, whether it involves altering the HTML or multiple CSS files withi ...

Efficient methods for adding data to pages using Node.js

Since transitioning from PHP to NodeJS, I have been exploring new ways of sending data and am curious if there is something equivalent to the 'echo' function in NodeJS. I am looking for a method that would allow me to send data in parts, enabling ...

Ensure the webpage is set to have a minimum width of 1024 pixels

Is it possible to make a webpage that utilizes bootstrap, Angular 2x, and Scss stop being responsive once the screen width reaches 1024px? I would like the layout to stay fixed at this size and enable horizontal scrolling for users who resize their browser ...

Ways to display multiple PHP pages in a single division

Within my project, I have a unique setup involving three distinct PHP pages. The first file contains two divisions - one for hyperlinked URLs and the other for displaying the output of the clicked URL. Here is an excerpt from the code snippet: <script& ...

I'm experiencing an issue where the Devtool appears empty when inspecting it, making it impossible to locate

I'm currently working on automating the process of entering data into web forms using Selenium VBA. The forms are located on our organization's SharePoint site, and I have already logged into the account. However, every time I reach the final ste ...

The functionality of the "#Next" and "#Prev" features in the Tiny carousel are currently not functioning properly within the MVC project

Looking to implement a simple content carousel using jQuery 2.1.3 in my project. Previously used a non-responsive jQuery content carousel and switched to find a responsive option:Tiny Carousel Added Tiny Carousel's .js and .css files to Bundles.confi ...

Customize Material-ui ListItem styles using @media queries

Looking to customize the appearance of ListItem in material-ui. My list of elements is populated and then returned to a Popover. elms.push(<ListItem key={i} primaryText={obj[i].title} onTouchTap={this.addGeotag.bind(this, obj[i])}/>) Adding style= ...

Using ngFor in Angular 2-5 without the need for a div container wrapping

Using ngFor in a div to display an object containing HTML from an array collection. However, I want the object with the HTML node (HTMLElement) to be displayed without being wrapped in a div as specified by the ngFor Directive. Below is my HTML code snipp ...