Tips for managing the dimensions of a select element in bootstrap

I need assistance with adjusting the width of select tags in my form so that they align properly with the text boxes above. Here is the HTML code:

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<form class="form-inline">
  <div class="form-group">
    <label class="sr-only" for="Title">Title</label>
                <input type="text" class="form-control" name='p_Title' value='' ng-model="reports.title" class='requiredAttribute' placeholder="Title">
  </div>
  <div class="form-group">
    <label class="sr-only" for="subTitle">Sub Title</label>
                <input type="text" class="form-control" name='p_SubTitle' value='' ng-model="reports.subtitle" class='requiredAttribute' placeholder="Sub Title">
  </div>  </form>
<br>

<form class="form-inline">
  <div class="form-group">
    <select class="form-control" name="category">
                <option value=""></option>
                <option value="0">select1</option>
                <option value="1">select2</option>
                <option value="2">select3</option>
            </select>      
  </div>
  <div class="form-group">
    <select class="form-control" name="category">
                <option value=""></option>
                <option value="0">select1</option>
                <option value="1">select2</option>
                <option value="2">select3</option>
            </select>      
  </div>
  </form>

Answer №1

Utilize Bootstrap's Grid System to organize them

You could try something like this

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<form class="form-inline">
  <div class="row">
    <div class="col-sm-6">
      <div class="form-group">


        <label class="sr-only" for="Title">Title</label>
        <input type="text" class="form-control" name='p_Title' value='' ng-model="reports.title" class='requiredAttribute' placeholder="Title">
      </div>
    </div>
    <div class="col-sm-6">
      <div class="form-group">
        <label class="sr-only" for="subTitle">Sub Title</label>
        <input type="text" class="form-control" name='p_SubTitle' value='' ng-model="reports.subtitle" class='requiredAttribute' placeholder="Sub Title">
      </div>
    </div>
  </div>
</form>
<br>

<form class="form-inline">
  <div class="row">
    <div class="col-sm-6">
      <div class="form-group">
        <select class="form-control" name="category">
          <option value=""></option>
          <option value="0">select1</option>
          <option value="1">select2</option>
          <option value="2">select3</option>
        </select>      
      </div>
    </div>
    <div class="col-sm-6">
      <div class="form-group">
        <select class="form-control" name="category">
          <option value=""></option>
          <option value="0">select1</option>
          <option value="1">select2</option>
          <option value="2">select3</option>
        </select> 
      </div>
    </div>
    </form>

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

utilizing the entire string rather than just a portion

I was attempting to create a JavaScript jQuery program that vocalizes numbers based on some previously saved data. However, I encountered an issue where only the last number in the sequence was being played (the final character in the string). Below is t ...

Steps to include a CSS file in Laravel 5.6 using npm

Here are the steps I've taken: Installed bootstrap-select using npm Edited resource/assets/bootstrap.js to add "require('bootstrap-select'); Executed npm run prod My Questions: Does the bootstrap-select library include sass or css files, ...

Is there a way to set a custom background image for a specific Vaadin view?

I am developing a view in Vaadin that looks something like this... public class PosAppPickerView extends VerticalLayout implements View { Everything is functioning smoothly, but I am interested in incorporating an image as the background for the body/mai ...

Generating an asynchronous event within a data grid column and dynamically displaying a button based on the received response

Currently, I am utilizing dataTables to display a list of institutions. Within the table, there is a column featuring a button that allows users to check the status of an API. While this functionality is operational, I now wish to make it trigger asynchron ...

Create a shiny application that makes text bold in the user interface

Can someone please guide me on how to make specific words bold in a sentence within the UI using HTML tags under the h() function? Your assistance is greatly appreciated. Thank you. library(shiny) ui <- navbarPage( title = 'Benvenuto&apos ...

Identifying page elements in Protractor when they lack obvious identifiable properties

Scenario Here is the HTML code snippet using an Angular JS template: <div class="data-handler-container"> <div class="row"> <div class="data-handler" ng-if="dataController.showDistance()"> <p>{{ 'Item ...

Why don't disabled buttons styled with color:inherit adhere to disabled button aesthetics?

In the example provided, setting the property color: inherit on a button element prevents a disabled button from appearing in a disabled state. I initially expected that due to specificity rules, disabled buttons would still display as disabled. I am curi ...

Arrange two images next to each other using Bootstrap grid system

Struggling to replicate the design of this website: Fister. But unfortunately, my images are not aligning properly. <html> <head> <meta charset="utf-8"> <!-- CSS only --> <link href="https://cdn.jsdeli ...

What is the process of utilizing jQuery to hover over a relevant cell?

I'm interested in learning how to implement jQuery to highlight related tables. Initially, I explored this JS fiddle and discovered a method for highlighting both vertically and horizontally. I conducted several searches to find a similar approach, ...

Can one determine whether an SCSS element is devoid of content?

Can SCSS be used to determine if an element is empty? For instance, I'm interested in assigning a variable based on whether the class has content or not. <div class="defaultClass"> <!-- This div is empty --> </div> Is there a w ...

Empty spaces in an "option" html gadget on a website created with Structr 4.1.2 Community edition

Currently using Structr version 4.1.2 on a managed Sandbox (Community edition) of Structr. I am currently investigating the functionality of Structr and have encountered an issue related to how an "html" select element functions on a page built in Structr ...

Removing the tick mark from a simulated checkbox

I'm looking for guidance on updating this code to manage unchecking an emulated checkbox. Let's start with the original input HTML: <input type="radio" name="rf538" id="rf538" class="page_checkbox"> Next, here is the CSS for the class pa ...

The Java Selenium "jsExecutor" is unable to click on the HTML element

A JavaScript HTML element is defined as: document.querySelector('[value="fixedsumcredit_kp"]') <input id=​"-0198e3aa-d2b1-46ce-bdf0-192e60662cd3-fixedsumcredit_kp" type=​"radio" name=​"-0198e3aa-d2b1-46 ...

Resolving VSCode WebViewPanel access issues through a corporate proxy

I am currently utilizing the "C4 DSL Extension" in VSCode to display previews of my architecture diagrams. These previews are generated through the WebviewPanel functionality. If you're interested, you can access the source code here: While everythin ...

Ways to implement multi-file loading on a website using separate HTML segments

Currently, I am working on a website for my local community. Each page contains similar content like header, navigation bar, and footer. I want to streamline this process by storing these common elements as separate HTML files. Is it possible to link the ...

Exploring the various viewport sizes in Bootstrap breakpoints

I'm currently working on a responsive cropping tool for multiple devices using cropperjs. Right now, I am estimating the viewport sizes for each bootstrap breakpoint but I need to determine the actual height in order to establish a ratio. You can view ...

After adding elements with jQuery, make sure to select them correctly

When I click a button on my page, it appends an element with the class .select2-selection__rendered. I need to get the text of this appended element for use in an AJAX call. However, when I tried to alert its text, I found that it was blank. The appending ...

How can I align Ion-Content to the bottom of the page in Ionic?

I'm having trouble positioning a message input box at the bottom of my page. I've experimented with using align-self-end and creating a css class for ion-footer, but nothing seems to be working. <ion-content> <ion-footer align-self-end&g ...

The option to clear searches is missing from the iOS interface

My application is designed to perform searches using post codes, and for the most part, it functions properly. However, I have encountered an issue where the clear icon on the right-hand side of the field does not display in certain browsers. To investiga ...

Prevent a div from being displaced by the transform property once it reaches the window's border

Is it possible to prevent the viewer I created using CSS transform from moving when its borders reach the window borders? Should I consider using a different method instead? If you'd like to see the code, you can check it out here. var x=0, y=0 ...