Creating responsive input fields involves designing them in a way that they adjust their

Looking for help to make my input fields responsive and align the columns in the middle of the page with margins all around like shown below. Also seeking samples created with HTML, CSS, Bootstrap for reference.

https://i.sstatic.net/DDR6m.png

<!DOCTYPE html>
<html>
<head>
    <title>Login/Register Form</title>
    <style type="text/css">
        body{
            margin:0px;
            padding:0;
            overflow-x: hidden!important;
        }
        .containor{
            /*text-align: center;*/
            margin:225px 3px 5px 3px auto;

        }
        .form-group input{
            width: 900px;
            height: 40px;
            border-color: silver;
            padding: 0;
            margin-top: 3px;
            margin-bottom: 10px;
        }
        .form-group label{
            text-align: left;
            padding-left: 3px;
            margin-bottom: 3px;
        }
        .buttons{
            margin-top: 20px;
        }


    </style>
    <link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6c0e0303181f181e0d1c2c59425d425f">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
</head>
<body>
    <div class="containor">
        <div class="row">
            <div class="col-6 col-sm-12 col-md-6 border" id="login_section">
                <form class="m-3" action="#" method="post">
                    <div class="form-group">
                        <h1 class="m-3 text-center">Welcome to Login Section!</h1>
                        <label>Email</label>
                        <input type="text" class="form-control" name="u_email">
                        <label>Password</label>
                        <input type="password" class="form-control" name="paswd">
                        <br>
                        <div class="buttons">
                            <button type="submit" class="btn btn-outline-info btn-block rounded-pill">Login</button>
                            <button type="rest" class="btn btn-outline-danger btn-block rounded-pill">Clear Credentials</button>
                            <a href="#">Forgot Password!</a>
                        </div>
                    </div>
                </form>
            </div>
            <div class="col-right-6 col-sm-12 col-md-6 border" id="reg_section">
                <form class="m-3" action="#" method="post">
                    <div class="form-group">
                        <h1 class="m-3 text-center">Don't have an Account yet!<br>Register Here</h1>
                        <label>Email</label>
                        <input type="text" class="form-control" name="u_email">
                        <label>Password</label>
                        <input type="password" class="form-control" name="paswd">
                        <label>Confirm Password</label>
                        <input type="password" class="form-control" name="confirm_paswd">
                        <br>
                        <div class="buttons">
                            <button type="submit" class="btn btn-outline-success btn-block rounded-pill">Register</button>
                            <button type="rest" class="btn btn-outline-danger btn-block rounded-pill">Clear Info</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</body>
</html>

If you have any examples similar to this form using HTML, CSS, and Bootstrap, please share them to gain more insights. Thank you!

Answer №1

Do you think this is what you need?

If so, then include the following style to prevent the input from moving out of the container.

.form-group input {
  width: 900px;
  max-width: 100%;
}

Interactive Example

body {
  margin: 0px;
  padding: 0;
  overflow-x: hidden !important;
}

.containor {
  /*text-align: center;*/
  margin: 225px 3px 5px 3px auto;

}

.form-group input {
  width: 900px;
  height: 40px;
  border-color: silver;
  padding: 0;
  margin-top: 3px;
  margin-bottom: 10px;
  max-width: 100%;
}

.form-group label {
  text-align: left;
  padding-left: 3px;
  margin-bottom: 3px;
}

.buttons {
  margin-top: 20px;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="55373a3a21262127342515607b647b66">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet"
  integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
  <body>
  <div class="containor">
    <div class="row">
      <div class="col-6 col-sm-12 col-md-6 border" id="login_section">
        <form class="m-3" action="#" method="post">
          <div class="form-group">
            <h1 class="m-3 text-center">Welcome to Login Section!</h1>
            <label>Email</label>
            <input type="text" class="form-control" name="u_email">
            <label>Password</label>
            <input type="password" class="form-control" name="paswd">
            <br>
            <div class="buttons">
              <button type="submit" class="btn btn-outline-info btn-block rounded-pill">Login</button>
              <button type="rest" class="btn btn-outline-danger btn-block rounded-pill">Clear Credentials</button>
              <a href="#">Forgot password!</a>
            </div>
          </div>
        </form>
      </div>
      <div class="col-right-6 col-sm-12 col-md-6 border" id="reg_section">
        <form class="m-3" action="#" method="post">
          <div class="form-group">
            <h1 class="m-3 text-center">Don't have an Account yet!<br>Register Here</h1>
            <label>Email</label>
            <input type="text" class="form-control" name="u_email">
            <label>Password</label>
            <input type="password" class="form-control" name="paswd">
            <label>Confirm Password</label>
            <input type="password" class="form-control" name="confirm_paswd">
            <br>
            <div class="buttons">
              <button type="submit" class="btn btn-outline-success btn-block rounded-pill">Register</button>
              <button type="rest" class="btn btn-outline-danger btn-block rounded-pill">Clear Info</button>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
</body>

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

Is it possible to customize the notification message displayed after clicking the save button in a listview within ng-admin?

While working on the listview/creation view, I am attempting to incorporate a custom notification message instead of the default one (please see the screenshot) that appears when the user clicks the save button. Is there a way for me to include a custom n ...

werkzeug.exceptions.BadRequestKeyError: 400 Bad Request: The server is unable to process the request sent by the browser or proxy. This error occurred in a Flask web application

Can someone guide me on troubleshooting this issue in Flask? I am still learning. Server running at (Press CTRL+C to exit) 127.0.0.1 - - [26/Jul/2020 11:19:45] "GET /predict HTTP/1.1" 500 - Traceback (most recent call last): raise exceptions. ...

Safari on IOS transition transform feature malfunctions

Every time I try to apply some code to make a div move, for example using the latest iOS Safari browser, it fails to transition between the two rules set. I have experimented with different values other than percentage but still haven't been able to m ...

Swap the < symbol with &gt; and & with &amp; within a specific node or location in an XML document

Hello everyone, I have a XML file with a node named Section, where certain characters like & and < are treated as invalid. I need to replace < with &lt; and & with &amp; only within the Section Node. Currently, I am using the following Java ...

Difficulty in showcasing error on the website with JavaScript

I have recently developed a webpage that includes several input boxes and a submit button within a form as shown below: <form action="" method="post" name="password"> Upon clicking the submit button, a JavaScript function is triggered to validate i ...

Accordion nested within another accordion

I am facing a challenge while trying to nest an accordion within another accordion. The issue is that the nested accordion only expands as much as the first accordion, requiring additional space to display its content properly. Any assistance with resolvin ...

What's the best way to ensure that my image remains perfectly centered at the point where the background colors of my

html <body> <header> <div class="indexHeaderWall" id="headerLeftWall"> </div> <img id="profilePic" src="icons/myPicture.jpg" alt="Picture of Daniel Campo ...

Close button situated at the top-right corner overlapped by HTML/CSS styling

Currently attempting to position a button overlapping and extending outside of its parent div, much like the illustration provided. However, my current efforts result in the button being contained within the parent DIV. The visual reference below showcases ...

What is the process for ensuring that an image is set as the submit button in an HTML form on IE 7?

My HTML form is designed with an action on a PHP script, and the submit button displays a custom image instead of the default grey. While this code works perfectly in Chrome, it fails to function properly in Internet Explorer 7. Do you have any suggestions ...

Do I have to include the HTML audio type when writing code?

Do we really need to specify the audio type in HTML, such as .mp3? I tried it without specifying the audio type and it seems to work just fine. So why is it important to include it? ...

Detecting When an Element is About to Be Deleted by Pressing Backspace in a Contenteditable HTML Element

As I develop a text editor using <div contenteditable>, one of my goals is to implement a confirmation message for users before they delete an image element within the editor. My idea is that when a user presses the backspace key while attempting to ...

Remove HTML formatting from excel cells and fill separate cells

Is there a way to condense HTML code and fill different columns in Excel? For instance, If my HTML code looks like this: <p></p>10-16-2013 22:35<br/>I love pizza! Ordering was a breeze!<p></p>10-16-2013 13:19:46<br />t ...

HTML/CSS - Troubleshooting Animation Issues

I am currently experimenting with different website animations and implementing responsive design. However, I encountered an issue when trying to apply these changes to my header, which also affects the .heading element. It seems that there is a problem w ...

In a responsive layout, a floating div refuses to adhere to the left alignment

I am working on a dynamic list using ASP:REPEATER with floating divs aligned to the left. The current layout is as follows: +---------------------+ +---------------------+ +---------------------+ | | | | | ...

How can I retrieve the transformation matrix for a DOM element?

Is there a way to retrieve the transformation matrix of a DOM element similar to how we can do it with canvas context? Does the DOM provide a getTransform() method for this purpose? ...

managing the action of a form to launch it with the help of facebox

Is there a way to use facebox to display a contact form and have the submit action also open in a facebox? Currently, I can easily open a link in a facebox using the rel attribute, like this: <a href="contact.html" rel="facebox">Contact</a> W ...

Leverage CSS variables within the `url('data:image/svg+xml')` function

Here is a CSS snippet I use to create a dashed border around a div: div { width: 100px; height: 100px; border-radius: 16px; background-image: url('data:image/svg+xml,%3csvg stroke="black" width="100%25" height="100%25" xmlns="http://www.w ...

Making a secure connection using AJAX and PHP to insert a new row into the database

Explaining this process might be a bit tricky, and I'm not sure if you all will be able to assist me, but I'll give it my best shot. Here's the sequence of steps I want the user to follow: User clicks on an image (either 'cowboys&apos ...

Tips for repairing damaged HTML in React employ are:- Identify the issues

I've encountered a situation where I have HTML stored as a string. After subsetting the code, I end up with something like this: <div>loremlalal..<p>dsdM</p> - that's all How can I efficiently parse this HTML to get the correct ...

Basics of CSS border-image explained

Although it seems simple, I'm struggling to figure out what the issue might be. I am attempting to create a div with a specific border on an ASP.Net webpage. CSS: .ResourcesDiv { border-image:url(http://blogrope.com/wp-content/uploads/2013/06/003-w ...