Enhancing User Interaction with Bootstrap Input Forms

Struggling with a CSS and Bootstrap issue, I am unable to find a solution. The problem I am facing is that the content in a div form is not responsive within its parent div. It always extends beyond the parent div and does not adjust its size when the screen size is changed for different devices. Inside a div class wrapper, there is a navigation and a div content.

<div class="wrapper">

     
        <!-- Sidebar -->
         <nav id="sidebar" >
         </nav>

       <div id="content">

          <div class="row main">
                <div class="col-lg-3">

                </div>
                <div class="col-lg-6 col-md-8 col-sm-12 col-xs-12 trade">

                </div>


                <div class="col-lg-3">

                </div>
         </div>


  </div>
          

Within the div content, there is one row containing 3 div columns. The middle column is where the issue lies.

<div class="col-lg-6 col-md-8 col-sm-12 col-xs-12 trade">
 <div class="tab_container">
                      
                         <div class="row">
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
                                    <form>
                                        <div class="input-wrapper">
                                            <div class="prefix">Price</div>
                                            <input type="number" id="price" placeholder="Price">
                                            <div type="text" class="css">Last</div>
                                            <div class="suffix">USD</div>
                                        </div>
                                      
                                     </form>
                                </div>
                                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
                                    <form>
                                        <div class="input-wrapper">
                                            <div class="prefix">Price</div>
                                            <input type="number" id="price" placeholder="Price">
                                            <div type="text" class="css">Last</div>
                                            <div class="suffix">USD</div>
                                        </div>
                                      
                                     </form>
                                </div>
                           </div>
                       
                    </div>


</div>

Its CSS code is as follows:

.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#content{
    width: 100%;
    padding: 14px;
    min-height: 100vh;
    
}

.tab_container{
   padding:1px;
    display:none;
}

form{
  
    background-color: #ffffff;
    border-radius: 10px;

  
}

.input-wrapper{
   
  
    display: flex;
   
  
    background-color: #222020;
  
    border: 1px solid #7b7b93;  
    margin: 10px 0;
    border-radius: 5px;
    
}

.prefix,
.suffix{
   
   
    color: #7b7b93;
}


.prefix{
    padding: 3px; 
    width:50px;
}
.suffix{
  
     width:60px;
    padding:2px 0px 0px 8px;
 
} 
.css,.cdd{
   
    padding:2px ;
    color:#f5f5f8;
}
input{
    background-color: transparent;
    text-align: right;
    color: #f5f5f8; 
    width:110px;
}

View on a desktop screen size: https://i.sstatic.net/wakQ0.png

View on a small laptop size: https://i.sstatic.net/1t2Yl.png The div content is not responsive and extends beyond.

View on a tablet: https://i.sstatic.net/0nU4I.png

View on a mobile device: https://i.sstatic.net/ytE02.png

The issue seems to persist due to the form not being responsive to screen size changes. I have attempted to adjust the Bootstrap grid columns to no avail. As my frontend experience is limited, I am seeking assistance on how to address this problem. Please help me find a solution.

Answer №1

Consider adjusting the sizing of your bootstrap columns and div classes for better responsiveness.

For instance, using a fixed width like 60px for "suffix" may cause issues on smaller devices with limited screen space. It's advisable to use percentages instead of pixels for better adaptability. Define the percentage of space "suffix" should occupy within the column.

Although not an expert in grids and bootstrap, I have faced similar challenges. I suggest exploring Webflow, a free tool for creating responsive grids tailored to various screen sizes. You can then transfer the generated code from Webflow to resolve layout issues on your website.

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 is causing the tabs to not update the navigation in nav-tabs?

I recently implemented a tab list using Bootstrap, similar to the one shown in the image below: https://i.sstatic.net/KEy7F.png However, I encountered an issue where clicking on "Profile" or "Contact" tabs does not change anything. Even though I inclu ...

What is the best way to create a CSS grid with horizontal overflow?

I'm currently working on a 4-column layout using CSS grid. As the browser width reaches a specific breakpoint, I want the first column to be fixed on the left side of the browser (X-axis) while the other columns scroll under it. Right now, I am utiliz ...

Sass compilation failed due to an error in the CSS code provided

Just starting out with sass, I recently downloaded bulma, installed gem, and sass. My attempt to compile a default sass file using sass style.scss style.css resulted in errors. Here is my directory structure: https://i.sstatic.net/0OZSR.png However, I en ...

Creating a div that is positioned below an input form when it is focused can be achieved using

I am aiming to achieve the following: https://i.sstatic.net/AxIXs.png My goal is to generate a new div positioned directly below the input form that has been selected (each of the 3 input fields displayed will have a distinct div underneath). The selectio ...

How can a new <li> element be created without being influenced by certain CSS styles?

I am attempting to enhance my menubar by adding a signup/login item aligned on the right without affecting the other center-aligned items. Essentially, I have an entry named "Login/Sign Up" that should maintain its own unique style while seamlessly blendin ...

A perfectly organized and justified menu with evenly spaced horizontal list items

I couldn't find a solution to evenly spacing out a series of list items for a menu styled list. After realizing CSS alone wasn't enough, I decided to incorporate some javascript (jQuery). My goal was to have equal padding between each LI without ...

Having to constantly deal with null checks is making the user interface of my Blazor WASM web

Adding a null check on a page seems to be causing issues with the UI, particularly affecting some of the bootstrap components. For instance: @if(Summary is null){ <Spinner /> } else { <div class="col-4"> <label cla ...

Creating a dynamic 2D image using HTML5 animation

As a beginner HTML5 developer, I have been exploring ways to create an animated image using multiple jpg files stored in a specific folder on my website. My goal is to design an animation of a rabbit running across the page when a user clicks on a button. ...

"Learn how to create a scrolling div using a combination of CSS and JavaScript with absolute and relative

After relying solely on "pre-made" components like Mui or TailWind, I decided to create a component using only CSS and maybe JavaScript. However, I encountered some difficulties when attempting to position a div inside an image using relative and absolute ...

How to position a Navbar on top of a grid background structure

I am currently working on developing a responsive website, and I have encountered a challenge that I need help with. I am looking to create a header using a grid system, where I have divided the header into two parts: col-md-4 : For an Image col-md-7 : ...

observing numerous directories in Sass

Is there an efficient way to monitor multiple directories in sass using a shell script? This is what I currently have in my shell script: sass --style compressed --watch branches/mysite/assets/css/sass:branches/mysite/assets/css & sass --style compre ...

Subnav sticks when scrolling down but becomes unresponsive on resizing

My webpage has a main header that sticks to the top of the window and a subnav fixed at the bottom. The hero image adjusts its height based on the window minus the header and subnav heights. When scrolling past the subnav, it sticks just below the main nav ...

Tips for refraining from transmitting visuals to cell phones in a more meaningful way

Typically when working on responsive or mobile-first design, media queries are utilized to deliver different CSS styles based on screen size. An optimal design strategy may involve not including any images in the default (small) resolution layout. While ...

I'm having trouble with jQuery recognizing the left-margin property. Is there a workaround for this issue?

I rarely use jquery, but I wanted to add animation to a side bar. The sidebar menu is 670px with a -670 left-margin. When the user hovers over it, I'd like the left-margin to change to 0px and reveal the hidden content. Upon mouseout, it should return ...

Resolving Div Alignment Issues in Internet Explorer with jQuery CSS AddClass and RemoveClass

I've set up an HTML table with a hover highlight feature using jQuery and CSS. Here's how my hover event is structured: $('#' + element.id + ' tr:not(:first,[class="summary_row"])').die('mouseover mouseout').live(&a ...

Is it possible to display a "click" message when a button is hovered over using CSS?

Whenever I hover over a button, I struggle to receive the appropriate message like "click" or "enter" before actually clicking it. How can I use CSS to style my buttons in a way that allows for this pre-click messaging? I have tried approaches such as .bu ...

Transforming the text to be "unreadable"

I find myself in a rather odd predicament where I must display my name and contact details on a webpage. Although I am comfortable with sharing this information, I would prefer that it remain unreadable to robots or other unauthorized sources. Essentially ...

How can I create a menu navigation in Bootstrap 4 similar to the one on the components website

Greetings! I am not a native English speaker, so please excuse any typos in my message. I am attempting to create a menu that functions exactly like the one on the Bootstrap components page, but with the distinction of appearing on the RIGHT SIDE: http:// ...

Adjust item size and move them into the panel

I am looking to create a panel that arranges items in a specific layout shown here: https://i.stack.imgur.com/qw3lS.png Below is the code I have attempted so far: import React, { useCallback, useEffect } from "react"; import { Box, Grid, Tab, T ...

Changing the color of a pseudo element in Material-UI

I'm having trouble changing the border color of the ::after pseudo element on a standard text field from MUI. I've been unable to figure it out. <TextField id="standard-basic" label="Email" variant="standard"/> ...