Alignment issues in buttons within Bootstrap

I'm facing an issue with the code snippet below

<div className="row">
                  <div className="col-md-3">
                    <DateTimePickerComponent
                      id="dateFrom"
                      name="dateFrom"
                      placeholder="Date from"
                      
                    />
                    <div className="d-flex align-items-center error-container">
                      {searchForm.touched.dateFromError && Boolean(searchForm.errors.dateFromError) && (
                        <span className="text-danger small">{searchForm.errors.dateFromError}</span>
                      )}
                    </div>
                  </div>
                  <div className="col-md-4">
                    <DateTimePickerComponent
                      id="dateTo"
                      name="dateTo"
                      placeholder="Date to"
                     
                    />
                    <div className="d-flex align-items-center error-container">
                      {searchForm.touched.dateFromError && Boolean(searchForm.errors.dateFromError) && (
                        <span className="text-danger small">{searchForm.errors.dateFromError}</span>
                      )}
                    </div>
                  </div>

                  <div className="col-md-4 d-flex align-items-center middle-align">
                    <DropDownListComponent
                      id="vouType"
                      dataSource={sessionLists}
                      
                    />
                    <Button variant="outlined">Detail</Button>
                  </div>
                </div>
              </div>

After running this code, I noticed that the DropDownListComponent and button appear as shown in this image

I want to center them vertically aligned with the text box like this image

Answer №1

When designing a responsive layout, make sure you align elements vertically based on your specified breakpoints. Consider adjusting the column size by using classes like col-sm-4 instead of col-md-4.

If you are experiencing issues, please share a screenshot of the problem to help us better understand and analyze it.

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

When clicking on a different tab, the Bootstrap tab will shift to the left, outlining the new selection

While working with Bootstrap, I created a small footer with a tab. However, whenever I click on the second value, the entire div shifts to the left. How can I keep it in place? Below is my code along with two images depicting how the first tab aligns corr ...

The exact problem with aligning the table

Below is a simplified version of my code: <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body style="font-size: 36px"> </body> </html> <html> ...

What is the best way to center align my button using CSS?

I'm struggling with aligning this button in CSS to the center: .btn { background-color: #44c767; -moz-border-radius: 28px; -webkit-border-radius: 28px; border-radius: 28px; border: 1px solid #18ab29; display: inline-block; cursor: poi ...

How can you animate a CSS fill effect from the border outward?

I've been struggling to find an answer to this seemingly simple question online. Can anyone explain how to animate a fill-in with a specific color of an element, starting at the border? For example, the border expands gradually until the entire shap ...

Tick the checkbox to indicate that I want to insert an image in the adjacent column for the same row

Every time I click on the checkbox, an image should appear in the adjacent column for that specific row. Despite using the addClass() method and targeting the td, the image is appearing in all rows instead of just the selected one. Could somebody help me ...

Maintaining Aspect Ratio and Adding Letterboxes with Next.js Image

In my Next.js app, there is a section dedicated to displaying selected photos from a gallery. It's crucial for this area to maintain a fixed size of 566px*425px as users navigate through images or when a photo is loading. While the layout is responsiv ...

Difficulty arises with z-index when hover effects are applied to clip-path shapes

I'm encountering an issue where I am attempting to make two clip path polygons overlap each other when hovered over by the mouse. I have been using z-index values and trying to adjust them based on which overlay is being hovered over, but unfortunatel ...

How to eliminate excess white space on the right side in Bootstrap 4

Could someone please clarify why I am experiencing a white space on the right side when using Bootstrap 4? This is the primary code block for the page. <main id="intro" role="intro" class="inner text-center"> <h2>Lorem Ipsum</h2> ...

During the initial cycle, the CSS keyframes animation may experience glitches, but it will run smoothly in subsequent cycles

Seeking advice on troubleshooting a CSS keyframes animation issue. I have created an animation with 5 frames where the background image fades and transitions to the next image smoothly in all cycles, except for the first cycle where it glitches before each ...

The Bootstrap 4 column is not floating properly to the right as it is leaving a gap on the

My right sidebar is not floating to the right and has space from the right side. You can view it at this link: <div class="col-md-2 col-lg-2 col-sm-2" id="right-sidebar" style="background-color:orange; float: right; right: 0!important; width: 100%;"& ...

Ways to enhance the resilience of the max-width property when utilizing PHP calls or dynamic CSS styling

I attempted to customize the CSS in page builder mode by adding the following code: #content { max-width: 2000px; } While in page builder mode, the desired effect was achieved. However, once I published the changes, the page reverted back to the prev ...

The I am facing an issue with Material-ui Grid where the width of the Grid item is too large and extending beyond the boundaries

I'm in the process of setting up a basic layout for a single-page application using Material-ui and React. My plan is to have a sidebar on the left-hand side and a main area on the right-hand side to display information. However, I am facing two issue ...

Fixing the issue: "Tricky situation with JavaScript not working within Bootstrap 4's div tag while JS functions properly elsewhere"

Currently, I'm working on implementing a hide/show function for comments using JavaScript. Fortunately, I was able to find a helpful solution here (thanks to "PiggyPlex" for providing the solution on How can I hide/show a div when a button is clicked? ...

Leveraging JSON data to dynamically create HTML elements with multiple class names and unique IDs, all achieved without relying on

Recently, I've been working on creating a virtual Rubik's cube using only JS and CSS on CodePen. Despite my limited experience of coding for less than 3 months, with just under a month focusing on JS, I have managed to develop two versions so far ...

Differences in CSS between IE10 and Chrome are causing compatibility issues

Website in question: What is causing the difference in display between IE 10 and other browsers? The website appears to function correctly on Chrome: IE 10: ...

Is there a way to modify the dimensions of this container? (CSS)

After performing a search and clicking on a result, a white bubble pops up on the map. I am looking to use CSS to make this bubble smaller as it is currently too large. Can anyone provide guidance on how to achieve this? ...

What is the best way to incorporate a jQuery script to make an engaging slideshow on my website?

I've been trying to develop a slideshow similar to the one showcased on this website. First of all: I am using Kompozer. My website is not yet live as I am still in the process of putting it together on my computer. To give you an idea, here is the d ...

The scrollbar CSS appears to be missing on iPhone browsers Chrome and Safari

After spending the entire day searching for a solution to override the irritating scrollbar issue on my iPhone, I came across this simple example: .scroller { background: lightblue; height: 1000px; max-width: 400px; margin: 90px auto; padding: ...

Adding Custom CSS File to an iFrame in Angular

Currently, I am attempting to include a CSS file in a third-party iframe to modify its styling. My initial idea was to employ the following code snippet: ngOnInit() { ... this.myIframe.nativeElement.document.head.appendChild('style.css') } U ...

Troubleshooting Bootstrap image alignment problem with columns on extra small screens

My website showcases screenshots of my software in a div element. Everything looks great on larger screens, but once I switch to a phone or resize the window, the images don't align properly, leaving empty space. Refer to the image below for clarifica ...