Guide: Transform Bootstrap 4 Inline Checkboxes into Stacked Format When Screen Size Is Altered

The new layout of checkboxes and radio buttons in Bootstrap 4 really caught my attention. However, I am looking for a way to switch between "stack" and "inline" based on the screen size. Although size tagging has been added for various elements, I haven't been able to figure out how to apply it to form-check and form-check-inline.

My ideal scenario would be something like this:

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="row">
  <div class="col-12">
    <div class="form-group row">
      <label class="col-sm-3 col-form-label text-left">Date Range:</label>
      <div class="col-sm-9">
        <div class="form-check form-check-inline">
          <input type="radio" class="form-check-input" id="rdo30" ng-model="vm.dateRange" value="30" ng-selected="true" />
          <label for="rdo30" class="form-check-label">Last 30 Days</label>
        </div>
        <div class="form-check form-check-inline">
          <input type="radio" class="form-check-input" id="rdo90" ng-model="vm.dateRange" value="90" />
          <label for="rdo90" class="form-check-label">Last 90 Days</label>
        </div>
        <div class="form-check form-check-inline">
          <input type="radio" class="form-check-input" id="rdoYTD" ng-model="vm.dateRange" value="YTD" />
          <label for="rdoYTD" class="form-check-label">YTD</label>
        </div>
        <div class="form-check form-check-inline">
          <input type="radio" class="form-check-input" id="rdoRange" ng-model="vm.dateRange" value="range" />
          <label for="rdoRange" class="form-check-label">Manual Date Range</label>
        </div>
      </div>
    </div>
  </div>
</div>

However, I wish to have the flexibility to change "form-check-inline" to "form-check-inline-md" or similar - allowing the radio buttons to stack until reaching the "MD" size, after which they should display inline.

Do you know if there is a built-in feature in Bootstrap 4 that allows me to achieve this, or is it not possible?

(This is not about design, but rather a code-related question. I am seeking assistance with the coding aspect of this issue.)

Answer №1

Utilizing the Grid System in Bootstrap allows for responsive design through the use of specific classes. For more information, visit this resource

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 disable a hyperlink using JavaScript or jQuery?

Is there a way to make the link only respond to a right mouse click? My goal is to hide the link when the user left clicks on it. I am currently using the following code to capture right or left mouse clicks: $(".hideDataFileLink").live('mousedown&ap ...

Performing a map or foreach function on an array of objects limited to the first 5 objects

I need to iterate through an array of objects, but I only want to loop through the first 5 objects and then stop. What is the most efficient way to achieve this? [ {"visibility": 10000,}, {"visibility": 10000,}, {"visibilit ...

Submit button on Ajax form causes automatic page refresh

After adding a simple Ajax form to my WordPress website, I encountered an issue where the validation works fine, but instead of sending the email, the form refreshes after submitting. Here is the code snippet: <script type="text/javascript"> jQ ...

PyScript <script type="py-editor"> Issue: SharedArrayBuffer cannot be used in an insecure environment

I am currently using PyScript to execute a basic Python script within my HTML file in order to show a pandas DataFrame. However, upon loading the page in the browser and attempting to run the code block by clicking the run button, I encounter an error rela ...

The Bcrypt hashed password does not match the password hash stored in Mongodb

When I use bcrypt.hash to encrypt a password, the hash generated is normal. However, when I save this hashed password in MongoDB using Mongoose, it appears to be different from the original hash. For example: Password hash: $2b$10$bUY/7mrZd3rp1S7NwaZko.S ...

Designate categories by utilizing the x-amz-tagging request header

I'm in the process of creating a Node program to upload files to aws s3, and I'm having trouble figuring out how to specify the x-amz-tagging with the request header. I attempted a solution, but it's not working as expected! function crea ...

How can I determine the appropriate time to hide the loading screen after the model has been loaded with gltfLoader and before the scene is rendered?

I am currently working on a project using threejs version 106, where I have integrated both the webGLRenderer and CSS2DRenderer. My main challenge lies in loading a glb model and displaying a loading progress bar utilizing the onProgress callback of the l ...

How can I transmit information to the model without relying on query string parameters in Express?

Currently, I am working with two controllers - authController and onboardingController. The authController communicates with the onboardingController using the following line of code: res.redirect('/onboarding/info?profileId=' + profile.id + &ap ...

How to efficiently eliminate redundant entries from an object array using JavaScript or React

I've been struggling to implement the solutions provided in this thread on removing duplicates from an array of objects. Unfortunately, I haven't found a satisfactory way to do so. In my current approach (which involves adding new iconsProps to ...

A runtime error occurred in ScriptResource.axd at line var f = ($telerik.isIE) ? document.createElement('<iframe name="' + this.get_id() + '">');

I am encountering an error during runtime in the ScriptResource.axd file, which is causing a major issue for me as I am unable to modify the code directly to fix it. The error seems to be specific to this line: ScriptResource.axd runtime error on line var ...

What is the best way to insert a new item into an array that is nested within an object?

Currently, I am delving into the world of using $resource in angularjs and finding great examples in this answer AngularJS $resource RESTful example. Fetching and creating records is working fine, but now my challenge lies in adding a "section" to an exist ...

utilizing symbols from a vector graphic icon库

There are countless icon images to be found on the internet. Recently, I came across this particular set and now I'm stumped on how to actually utilize them. Despite my efforts to find tutorials online, I have come up short in finding any helpful reso ...

Softening the edges of a table

Could you assist me in rounding the corners of my table? I attempted using the basic border-radius, however, it only separated the border at the corners. Do you think this issue is due to my browser (Firefox) or could it be a bug? You can view my Jsfiddl ...

Implementing a more efficient method for incorporating UUIDs into loggers

------------system1.ts user.on('dataReceived',function(data){ uniqueId=generateUniqueId(); system2.processData(uniqueId,data); }); ------System2.ts function processData(u ...

Cross Domain Requests in Internet Explorer: Preflight not being sent

I have come across several similar discussions but none of the solutions provided have worked for me so far. Issue: In our current setup, we have three servers hosting our http-apis - two for testing and one for production. Lately, we have been deployin ...

Vue's innate lifecycle hook

I am looking for a way to automatically run a specific function as a beforeMount hook in every component of my Vue project without having to declare it individually. Essentially, I want a default behavior where if the hook is not explicitly stated in a com ...

Use Google Maps to plan your route and find out the distance in kilometers as well as the

Feeling a bit overwhelmed with the project I'm working on, but hoping for some guidance. We're aiming to create a form where users input a starting point and an ending point, similar to the examples on Google Maps (http://code.google.com/apis/ma ...

Retrieve the array from the response instead of the object

I need to retrieve specific items from my database and then display them in a table. Below is the SQL query I am using: public async getAliasesListByDomain(req: Request, res: Response): Promise<void> { const { domain } = req.params; const a ...

Creating a task list without using JavaScript in the web browser and without relying on a database

Looking for some guidance on building a todo app for a job interview where JavaScript is disabled in the browser and no database can be used. Any JavaScript needs to be handled on the server side. I have some basic knowledge of node/express and serving H ...

Is there a way to showcase English and CJK text vertically with CSS?

This particular issue was first discussed 14 years ago on Stack Overflow, but a definitive solution still remains elusive. My goal is to have both CJK and Latin characters displayed vertically, with their bottoms facing the right side. While writing-mode ...