Switch the alignment of Bootstrap checkboxes from vertical to horizontal

I'm looking to have my checkbox elements aligned horizontally instead of the default vertical alignment in bootstrap.

To achieve this, I've added the following CSS code:

.checkboxinsameline{
    display:inline;
}

Here's the HTML structure:


               <div class="row">
                <div class="form-group">
                    <label class="control-label col-md-2">Ekstra Tanım Tipi</label>
                    <div class="col-md-3">

                            <div ng-repeat="item in DefinitionTypes">
                                <label class="checkboxinsameline">
                                    <input  type="checkbox" name="item.value" ng-click="DefinitionTypesChecked(item.id)"> {{item.value}}
                                </label>
                            </div>

                        </div>
                    </div>
            </div><br />

Any suggestions or assistance on how to make this work would be greatly appreciated.

Answer №1

To resolve the issue, add the checkboxinsameline class to the div instead of the label as shown below:

<div class="checkboxinsameline" ng-repeat="item in DefinitionTypes">
     <label>
            <input  type="checkbox" name="item.value" ng-click="DefinitionTypesChecked(item.id)"> {{item.value}}
     </label>
</div>

This adjustment should address your concern. If not, please provide a fiddle or plunker demonstrating the problem.

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

Background images flanking both sides

What is the solution to making this function properly? <html> <head> <style type="text/css"> .left { float: left; background-image: url('image_with_variable_width.png'); background-repeat: repeat-y; } .right { float: right; bac ...

What is the best way to extract menu and submenu information from an array?

I'm in the process of building a webpage with the help of smart admin and I'm facing an issue with displaying left menu data properly. The data is being retrieved from an array and I need to arrange the menus and submenus based on the parent ID o ...

Exploring the functions of Safari input types: search, reset, and normalize

Is there a proper way to reset the appearance of a search input so that it resembles a text field in Safari? screenshot I'm experiencing an issue with Safari where there is unwanted padding on the left side of the search input that I can't seem ...

What is the best way to enable a function in a component to utilize a factory imported in the constructor?

Struggling to share data between components, I followed this advice on creating a store from this source. While it works smoothly within my component's constructor, I'm having trouble giving the functions similar access. class Home { construc ...

What's the reason behind jQuery's position() and offset() methods returning decimal numbers in Chrome browsers?

In my HTML document, I have a simple div tag that is absolutely positioned. In Chrome, when I set the CSS rule "right" to a fixed value in pixels and "left" to "auto", then use jQuery's position() method to determine its left position immediately afte ...

The animation function in A-frame causes entities to vanish when used with D3.js

Working with the animation property in D3.js has been a bit of a challenge for me. When I include the a-animation directly in the HTML section, everything works as expected. <a-box id="box" position="0 1 0" rotation="0 0 0" scale="1 1 1" color="#4CC3D9 ...

Checking if a particular header is configured in $http.defaults.headers.common within AngularJs

As a newcomer to the world of JavaScript and AngularJS, my coding skills are still in progress. I have recently been working on implementing a basic login page with a REST Backend. Once the Login Form is submitted, an authentication-token is returned and s ...

Adjust the height of the parent element containing the divs nested within the span

I recently created a unique square grid of SVG icons and positioned them directly to the right of some text within a header. The code for creating this grid looks like this: <div>HEADER TEXT <span> <div> <svg></ ...

What is the best way to create a seamless transition effect for two floating divs as they move in sync with each other

I'm in need of some assistance with CSS coding. I am currently working on creating a sidebar that slides in, similar to mobile pages, but instead of using absolute positioning, I have opted to float two divs inside a wrapper. My ability to explain th ...

execute a function once the preceding function has finished running

When completing a success callback for an ajax query, the following tasks need to be accomplished: a) Updating the property of an object in an array (and locating that specific object within the array) b) Saving the updated array back into storage c) Bro ...

Having trouble uploading images using ReactJS on the web platform

I am currently in the process of developing a portfolio website using react js, but I'm experiencing an issue where the image I intended to display is not showing up on the live site. Despite thoroughly checking my code, I can't seem to identify ...

What are the strategies used by AngularJS's official website to create SEO-friendly pages?

If you're interested in seeing how AngularJS.org presents pre-rendered content to search engine bots and scrapers, take a look at http://docs.angularjs.org/?_escaped_fragment_=/tutorial/step_09 I'm intrigued by the implementation strategy used f ...

Integrate a Google Maps API Javascript into a Flex application

I'm trying to incorporate a Google Maps API JavaScript into my Flex Application, but I have been unsuccessful so far despite looking at various examples. If anyone has any tips or guidance on how to achieve this, I would be extremely grateful for you ...

I'm currently experiencing a challenge with a project I'm tackling that specifically deals with chart.js

In my recent coding project, I created a script to gather user input and then present it in various chart formats. However, upon executing the code, the selected chart fails to display after inputting values and clicking on the "generate chart" button. Her ...

Utilizing AngularJS to Transform String Formats

I need to transform multiple strings using AngularJS: String 1 Convert strings to 10 digits without the letter at the beginning A 908915-10 == 0090891510 B 6918546-05 == 0690891510 C 90002135-00 == 9000213500 String 2 Transform decimals to 10 d ...

What are some recommended guidelines for utilizing $rootscope in an Angularjs project?

In our expansive Angularjs 1.6 application, $rootscope is utilized in various parts of the app such as filters, services, and routes over 200 times. As we consider refactoring, it becomes essential to determine the best approach for removing instances of $ ...

Steps for including a URL in an ng-repeat when it is not included in the JSON object

After making a http call, I am getting a JSON object. One of the properties within this object is LinkUrl. Sometimes, LinkUrl will contain a predetermined URL from the returned object, while other times it will only have a file name. In the latter case, I ...

Tips on keeping an HTML element from shifting when resizing the browser window (how to lock an element in a specific position on a webpage)

As a newcomer to front-end web development, I recently attempted creating a basic responsive page. While working on this project, I encountered an issue with the candle holder image. This image is size-responsive, meaning it adjusts in size as the browser ...

The text in the form's text area refuses to wrap onto multiple lines, it just continues to roll endlessly

I'm encountering an issue with a form on my client's website, specifically in the footer and contact page. For some reason, the text area box in the form does not automatically move to a new line when it reaches the end of the box - it just keeps ...

The circle border-radius is refusing to slide to the center of the screen

I'm having trouble moving the top circle to the center, while the bottom three circles are displaying correctly. I need to adjust the text and icon placement in the circles to be centered. Additionally, I want the layout to be responsive across differ ...