creating a text box that matches the dimensions of the one before

I am working on my form and trying to adjust the width of the Address1 text box to match the Last Name text box. The goal is to have the Address1 text box end where the Last Name text box ends. Below is the relevant code snippet:

 <div class="row">
      <div class="col-md-4">
        <label>First Name</label><br />
        <input runat="server" ID="fName" class="textboxsizeLarge borderText" />
      </div>
      <div class="col-md-4">
        <label>Middle Name</label><br />
        <input runat="server" ID="MdName" class="textBoxSizMd borderText" />
      </div>
      <div class="col-md-4">
        <label>Last Name</label><br />
        <input runat="server" ID="lname" class="textboxsizeLarge borderText" />
      </div>
    </div;
    <div class="row mt-3">
      <div class="col-md-12">
        <label>Address1</label><br />
        <input runat="server" ID="address1" class="borderText col-md-12" />
      </div>
        </div>
        <div class="row mt-3">
      <div class="col-md-12">
        <label>Address2</label><br />
        <input runat="server" ID="address2" class="borderText  col-md-12" />
      </div>
        </div>


<style>
.textboxsizeLarge{
 
    width:70%;
}

.textBoxSizMd {
    width: 30%;
}



.textboxsizebig {
    width: 100%;
}

.borderText {
    border: 1px solid black;
    padding: 1px;
}
</style>

Here is a screenshot showing the current appearance of the text boxes:

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

To achieve alignment, I want the Address1 width to extend all the way to the end of the Last Name text box.

Answer №1

It seems like there may be an issue with how you are utilizing the col-md class. By setting the width of the text box within a col-md-4, you are already restricting its size, causing inconsistencies across elements.

I created a codepen example to demonstrate this: https://codepen.io/sean-mooney/pen/rNOqaLb

In my example, I used col-md-4 and col-md-12 to define the size of the textbox container while ensuring the textbox remains at 100% width. This allows the textbox to adapt to the container's size based on the specified column size.

I hope this explanation is helpful!

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

Issues with hover functionality in React Material Design Icons have been identified

I'm facing an issue with the mdi-react icons where the hovering behavior is inconsistent. It seems to work sometimes and other times it doesn't. import MagnifyPlusOutline from "mdi-react/MagnifyPlusOutlineIcon"; import MagnifyMinusOutli ...

Encountered an issue when trying to generate a shader cache entry- there was an error when attempting to locate an

Today, I decided to write a basic Python script utilizing Selenium that would identify an element by its Css selector. My target? The input field on the Google webpage, specified by input[name=q] Upon running the script, Chrome opened as expected but prom ...

Variations in CSS Stylesheets for Various Parts of the Body

Currently, I am in the process of creating a single page website. One issue that I have encountered is needing a Bootstrap "modal" class popup to appear when a button is clicked. However, the template I am utilizing was designed using Bootstrap Version 1, ...

Tips on improving a function that verifies the existence of an image used as a CSS background to output a boolean value

I have encountered a challenge while working on a react file-upload component. The issue at hand is relatively simple - I aim to display an icon corresponding to the file extension for each uploaded file. These icons are loaded through css as background im ...

Guide on using jQuery to replace the applied css of an aspx control

My dilemma revolves around an AspxFileManager. I am attempting to distinguish a file when it is loaded by adding a class that places a border around the element. My initial attempt using .attr('style', 'border: 10px!important'); was uns ...

Is it possible to access forms and input fields in an AngularJS script without having to pass them from the HTML code?

Seeking a solution for input field validation, I have written code where input field states are passed from HTML to a script through a function. However, my goal is to directly retrieve the values in the script without passing them from the HTML when calli ...

Instructions for passing a single value from a while loop and showing a different value in a text box through PHP

Can one value be displayed while sending another value in an Input text field simultaneously? I have a form that displays details in descending order, but when I update the details from another page, they are being updated in ascending order instead. Cod ...

How can I modify the value of a CSS animation rule in AngularJS?

I am looking to dynamically change the value assigned to stroke-dashoffset based on a custom input. @-webkit-keyframes donut-chart-1 { to { stroke-dashoffset: 100; } } @keyframes donut-chart-1 { to { stroke-d ...

Support for TrueType fonts in web browsersLet me know if you

If I have a custom font in TTF format and want to check if @font-face supports it, what script can I use? What are the available options? ...

Is it possible to leverage Chrome for troubleshooting the reason behind a failure to load a Truetype font?

For my website, I am currently facing a problem with loading a ttf font. The error log only provides a generic message stating that the font failed to load, without any specific details regarding the cause. Interestingly, the font works perfectly fine on m ...

Is there a way to prevent the Sticky Footer from obscuring the content?

How can I prevent a "sticky" footer from overlapping the content on certain pages while still maintaining its stickiness? I attempted to use min-height: on HTML and body, but it did not resolve the issue. CSS: html { background: black url(images/bg2 ...

Implementing Grid column reversal in React with the help of Styled components

I am trying to reverse the order of these components. I have tried using standard display: grid; and Google suggested grid-auto-flow: dense;, but it didn't work as expected. Could the issue be with the structure of the components? Ideally, I would lik ...

Substituting HTML checkboxes with highlighted images for consistent display across different web browsers

I am looking to transform a list of HTML checkboxes into clickable images for the user to select or deselect. My goal is to create a similar functionality as shown in this video using just CSS if possible. I have successfully implemented it in Chrome wit ...

Selected a radio button within a jQuery UI dialog box

After using jquery-ui, I was able to create a simple dialog window. It looks like this: <div id="dialog-form" title="Add Attribute Category"> <input type="radio" id="priceable" name="price" value="true" checked="checked"/> Priceable &l ...

What is the best way to trigger the second function on a click event?

Is there a way to trigger my 20 second timer with the click of a button, followed by an alert after the timer ends? HTML <aside class="start-box"> <button type="submit" class="btn btn-primary btn-lg" id="toggleBtn" onclick="startCloc ...

Implementing jquery into Angular 2 webpack project is essential as jQuery is necessary for Bootstrap's JavaScript to function properly

I am currently utilizing the angular-cli .net core starter. As I attempt to incorporate my own CSS and JavaScript files, I encounter the following error: An unhandled exception occurred while processing the request. Exception: Call to Node module fail ...

Angular4 - Div with ngIf doesn't respond to click event

I'm attempting to add a click event to a specific div. Within this div, there is another div that is dynamically generated based on a Boolean condition that I receive as input. Unfortunately, in this case, the click event is only functioning when clic ...

Close the Hopscotch modal when moving to the next step or reaching the end

I'm having trouble figuring out how to close the modal after opening it. Initially, I can open the modal successfully using the following code: onNext: function() { $('#modal').modal('toggle'); } However, when attempting to cl ...

Clear Foundation Table

Having trouble creating a transparent table using the Foundation framework. I was successful without the framework, but it's just not working with it. Any tips or suggestions would be greatly appreciated. table { text-align: center; } table thead ...

Sorting rows dynamically with jQuery Tablesorter

I've been struggling to find a solution for my specific issue. I need to have a static row in a large table that will not sort or move, allowing for repeated headers. Can anyone offer assistance with this? $("#dataTable").tablesorter({ ...