Creating responsive designs using MDBootstrap 4

Currently, I am utilizing mdbootstrap4 to develop a prototype user interface for a web application.

My main objective is to make the login container adapt its size as the screen width changes. I want it to scale up when the screen widens and adjust to mobile UI patterns when the screen narrows down, with the login button taking precedence and occupying the full width of its container on mobile devices. However, I have encountered issues where the link text overflows or the button's dimensions become distorted and overlap with the text.

Furthermore, I am struggling to resolve the responsive ordering and alignment problems.

This is an excerpt of my code:

<div class="container">
    <div class="row">
        <div class="col text-center text-white">
            <!-- Headers -->
        </div>
    </div>

    <div id="login-form" class="row justify-content-center mt-5">
        <div class="col-lg-6 col-md-8 col-10">
            <div class="card">
                <div class="card-body">
                    <form name="">
                      <div class="md-form">
                        <i class="fa fa-user prefix grey-text"></i>
                        <input type="text" id="form1" class="form-control">
                        <label for="form1">Email Address</label>
                      </div>
                      <div class="md-form">
                        <i class="fa fa-lock prefix grey-text"></i>
                        <input type="password" id="form2" class="form-control">
                        <label for="form2">Password</label>
                      </div>

                      <div class="container mt-5">
                        <div class="row align-items-center text-right">
                            <div class="col-12 col-sm-12 col-md-8 order-first order-sm-last text-right">
                                <a href=".">Forgot Password?</a>
                            </div>
                            <div class="col-12 col-sm-12 col-md-4">
                                <button class="btn btn-primary btn-block order-last order-sm-first" target=".">Login</button>
                            </div>
                        </div>
                      </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

I've been experimenting to find a refined solution to this problem. Can anyone provide guidance in the right direction?

Answer №1

Give this a shot

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<div class="container">
    <div class="row">
        <div class="col text-center text-white"> 
            <!-- Headers --> 
        </div>
    </div>
    <div id="login-form" class="row justify-content-center mt-5">
        <div class="col-lg-6 col-md-8 col-10">
            <div class="card">
                <div class="card-body">
                    <form name="">
                        <div class="md-form"> <i class="fa fa-user prefix grey-text"></i>
                            <input type="text" id="form1" class="form-control">
                            <label for="form1">Email Address</label>
                        </div>
                        <div class="md-form"> <i class="fa fa-lock prefix grey-text"></i>
                            <input type="password" id="form2" class="form-control">
                            <label for="form2">Password</label>
                        </div>
                        <div class="container mt-5">
                            <div class="row align-items-center text-center">
                                <div class="col-12 col-sm-12 col-md-8 order-last order-sm-last text-right"> <a href=".">Forgot password?</a> </div>
                                <div class="col-12 col-sm-12 col-md-4 order-md-last">
                                    <button class="btn btn-primary btn-block order-last order-sm-firstt" target=".">Log In</button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

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

Issue with HTML-React-Parser failing to convert content from TinyMCE in React blog post component

Currently, I am in the process of developing a blog using React and Material UI. The main feature of this blog is a single page where users can view any post in full detail. Users submit post data through TinyMCE, which is then saved to a JSON file in raw ...

Using Angular's ngIf directive to dynamically add the selected attribute to an option based on a specific string

I need to dynamically set the selected attribute for an option in a select drop-down list. Here is an example of what I want to achieve: <select name="gcodeProfile"> <option value="HT Translucent F WF 500 um.gcode.profile& ...

CSS Panel Assignments

I am attempting to split the screen where 80% is dedicated to displaying a Google map at the bottom, and the remaining 20% displays content in a div with the ID '#data' at the top. However, the code below does not seem to achieve this layout as i ...

Potential Issue with CSS General Sibling Selector

It seems like I have encountered a potential bug with the General Sibling Selector. When I use p ~ div, the selector does not work as expected. However, when I replace p with the specific class name text_paragraph, it works fine. You can view my code and f ...

JQuery's accordion with the heightStyle set to "fill" is causing a vertical scrollbar

I recently integrated the JQuery accordion effect into my website and specified the heightStyle: fill so that it would occupy the entire window. However, it seems to be taking up an additional 1 or 2 pixels, causing the vertical scroll bar to appear. I su ...

Unable to locate the tag using .find() function following the use of .attr() method

I am currently utilizing jQuery in conjunction with node-horseman to interact with a specific page. My approach involves referencing the page's data-id attribute, which I then pass to my application to search for the li element containing this attribu ...

What is the best way to achieve a smooth rotation effect ranging from 1° to 359° using HTML/CSS in conjunction with JavaScript

Currently, I am retrieving rotation data from a sensor and transmitting it to a webpage containing a 2D-Model that rotates based on this data. To ensure a smoother motion, I have incorporated a CSS transition. However, an issue arises when the rotation da ...

Background images in Google Chrome browser only become visible after I manually modify the element's CSS using the inspect tool

The issue I'm facing is with the Google Chrome browser not displaying background images unless I inspect the element's CSS using the inspecting tool. I have an anchor tag set with the following properties: display: block; float: left; width: 2 ...

Converting text from Czech to English and vice versa

I have made progress in my Flask project. My goal is to translate words from slovnik.seznam.cz and store the translations in consecutive links. I am close to completion, but I am encountering an issue with extracting the header and word type (such as noun, ...

How can I use jQuery to automatically redirect to a different HTML page after updating a dynamic label?

When I click on a button in first.html, a function is called to update labels in second.html. However, despite being able to see second.html, I am unable to see the updated values in the labels. Can someone please advise me on how to achieve this? functi ...

Unable to change Gutters to 0 in the .container-fluid class in Bootstrap 5.2

I have gone through all the answers related to my question, but I couldn't find a solution for it. Below is the HTML code with Bootstrap 5.2 that I am working on: <section id="title"> <div class="container-fluid"> ...

"Implementing form validation, utilize JavaScript to dynamically insert an unordered list containing list items (li) into a specified div

When validating a login form, I encountered a challenge with displaying errors using an unordered list for each validation error such as an incorrect username or email format. I am familiar with input validation but struggling with incorporating an unorder ...

Chrome experiences animation delays caused by the mix-blend-mode property

Upon launching Chrome and viewing my fiddle in fullscreen mode, you may notice that the animations are not as smooth as desired. The sliding motion of the div and text seems to lag a bit. Interestingly, resizing the browser to a smaller size resolves this ...

Execute a function in wxHtmlWindow after the page has finished loading

I'm currently facing an issue with wxPython that I could use some help with. My goal is to create a basic HTML window with forward and backwards navigation buttons. However, I'm encountering difficulties when users click on links within the page. ...

Animating a jQuery Knob as you scroll from 0 to a set value

I am new to jQuery and currently working on jQuery Knob. Everything is functioning properly, but I have encountered an issue. When scrolling to the section with the knobs, I would like them to animate from 0 to a specific value. Is there a way to achieve ...

Is it possible to toggle between thumbnails and a larger image in a jQuery gallery?

Hello, I am new to website development and I would like to create a jquery based photo gallery for my personal website. One feature that really catches my eye is this one (for example): The gallery has a large thumbnail grid where you can click on a thumb ...

Use include files to wrap content in a div tag

I have a webpage index.html with the following JavaScript scripts: <script type="text/javascript> $(document).ready(function() { $('a.link').click(function() {var url = $(this).attr('href'); $('#content'). ...

Is it possible for me to store items in the local storage of my browser's Windows

Lately, I have been frequently using the following code: var store = window.localStorage; var accountID = store.getItem('AccountID'), pageID = store.getItem('PageID'), referenceID = store.getItem('ReferenceID&apos ...

Analyzing HTML markup to locate an anchor tag

While attempting to parse an HTML code using BeautifulSoup in order to retrieve a link that is hidden and does not appear on the website, I have encountered difficulties as it only retrieves links visible on the page. Is there a method to effectively par ...

Ways to .focus() on input field while using Modals in Bootstrap

When I activate this Modal, I would like the mouse cursor to automatically focus on the textbox Therefore, my goal is to ensure that the textbox receives focus() upon modal opening. This involves both CSS and JS files <link rel=& ...