implement segment button using html, css and bootstrap - html

I need to implement a segment button using only HTML, CSS and bootstrap as shown in the below picture. many people confuse between toggle and segment buttons. toggle-button toggles between on-click but the segment button can have multiple buttons and will toggle only on clicking the particular button. In my case, I need to implement only 2 buttons within 1 segment button. if my statement confuses, please follow the link and there is an example. any help is appreciated. thank you.

In Bootstrap, this feature is called "Button-Group", check this Reference: https://getbootstrap.com/docs/4.0/components/button-group/
You can style your Button-Group as you desire - if you want to e.g. put icons in it, just replace the text in the example ("left/middle/right") with an icon

Related

jQuery hide div that contains certain text

On my website I have 3 types of employees
barista
barista01
security
and I would like to hide the barista01 option but leave the others as they are (please refere to the picture).
When i try to use $("div:contains('barista01')").parent('div').hide(); I get a full black window hiding everything inside.
Is there anyway how to fix this?
Thank you in advanced
enter image description here
If Class name ".hc-mt3" is fixed and will not change then you can target that class.
See Example Code: $("div:contains('barista01')").parent('.hc-mt3').hide();

Dropdown form overlaps in boostrap 3

I'm trying to implement a dropdown with an input but whenever I try to click the dropdown, it overlaps to the other row of the table since the inputs are inside the table. Please see my screenshot below.
Screenshot:
Note: This is pure bootstrap 3, and didn't add any customization yet.

How to hide <select> and toggle (open) with a button

I'm using bootstrap 3 and am trying to imitate jQueryMobile's select option where you can replace the standard select textbar and arrows with just a button which toggles the opening of said select.
I don't want to use dropdowns either because they get hidden inside my nested divs (if you can make them appear at the topmost layer, then that's fine too).
So I'm wondering if there's a way to have a button as a stand-in for opening the select options.
Not totally sure on this, need a little more information. But you can create a button with:
<button type="button" onclick="alert('Message')">Button</button>
if that what you wanted?
This isn't exactly what you asked for but I did a search and found this plugin and I think if you were to experiment with this then you could come up with the desired effect. Give it a look over.
Theres a spot about a 1/3 of the way down the page which I think would help you decide if this would work.
Plugin: Bootstrap-Select

How to have radio button behaviour for divs while using angular?

So I'm starting with angular and I would like filter a list depending on which div is currently selected.
They are selected by being cliked. I suppose this is exactly how radio buttons behave but they are ugly and I would like to have a completely designed div (not just label) which is to be clicked.
I've read that you can add label with for attribute and hide the radio button to have something similar. I suppose what I would like is to be able to add for on a div to bind it.
What would be the best way to achieve this The Angular Way ?
You will find your solution at angular ui bootstrap goto buttons sections

Styling radio buttons that are not clicked

I am wondering if there is a CSS-only way to style those radio buttons of a radio button group that are not clicked after one of them was clicked.
Let's rephrase to clarify. I have a radio button group. Initially, all buttons are in the default state with no button selected. Now I click one radio button so that one now becomes selected. At this point, is there a way to give the other non-selected buttons a different style?
Please note that I don't need help with custom styling radio buttons. I know how to do that. This is specifically about the use case described above.
No, there is no attribute that the CSS can be linked to. There is only checked and "not checked". You'll have to do do some JavaScripting to get this done.