bootstrap-4

Add active class to menu item

安稳与你 提交于 2019-12-31 07:31:11
问题 Using Bootstrap 4 v6, I have the following navigation: I'm trying to set the active class on the selected menu item, but nothing I've done has worked. The closest that I've come is with this code: $(document).ready(function() { $('.navbar ul li').click(function(e) { $('.navbar ul li.active').removeClass('active'); var $this = $(this); if (!$this.hasClass('active')) { $this.addClass('active'); } e.preventDefault(); }); }); <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap

Place tab in Shiny tabsetPanel on the right

孤街浪徒 提交于 2019-12-31 02:31:12
问题 By default tabs in a tabsetPanel are put on the left. Is it possible to place a tab on the right side, while still having other tabs on the left? So that it looks like this? library(shiny) ui <- fluidPage( tabsetPanel( tabPanel("tab_left1"), tabPanel("tab_left2"), tabPanel("tab_right") ) ) server <- function(input, output, session) {} shinyApp(ui, server) 回答1: Using float-right should indeed work. The problem with using 2 tabsetPanel is that there are 2 active tabs at the same time. library

Bootstrap 4: Always display the mobile menu button no matter screen size

余生长醉 提交于 2019-12-31 01:54:09
问题 How can I get always display the mobile menu button no matter screen size? I do not want the links to appear until a person clicks the mobile button. Thank you! I realize there is a post here on Bootstrap 3, however it does not work with Bootstrap 4. Will you please advise? 回答1: Update Bootstrap 4.1.x Exclude the navbar-expand* class. As of beta, the navbar-toggleable-* class was replaced with navbar-expand-* , but now everythings moves up a tier. Since the default state of the navbar is

Bootstrap 4.0 “Modal” not working with Angular 4

故事扮演 提交于 2019-12-30 22:53:15
问题 Having trouble getting a Bootstrap 4.0 modal to work within an Angular 4 project. The modal works great inside a simple static HTML page: https://jsfiddle.net/Lq73nfkx/1/ <!-- MODAL --> <!-- Button trigger modal --> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal"> Launch demo modal </button> <!-- Modal --> <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal

How to create a dropdown submenu on hover in Bootstrap 4.1?

≡放荡痞女 提交于 2019-12-30 18:27:06
问题 I am working on a website in which I want to create a dropdown submenu on hover in Bootstrap 4.1 The HTML code which I have used in order to create a dropdown menu on hover are: <div class="navbar-collapse text-center" id="navbarResponsive"> <ul class="navbar-nav ml-auto"> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> main menu </a> <div class="dropdown

How to remove outline in bootstrap 4

微笑、不失礼 提交于 2019-12-30 17:23:08
问题 I want to remove textbox outline in bootstrap 4 but its not working. please let how can i remove this line. CSS #content #main-content input[type=text]{ border: 0; border: 1px solid #ccc; height: 40px; padding-left: 10px; outline: 0; } html <div class="form-group"> <label for="title">Title <span>*</span></label> <input type="text" class="form-control" id="title" name="title" placeholder="Enter Title"> </div> 回答1: The theme you're using sets box-shadow to inset 0 -2px 0 #2196F3 on focus . You

What's the meaning of ml in bootstrap 4?

你离开我真会死。 提交于 2019-12-30 09:44:07
问题 Hi I'm using bootstrap4 beta. I noticed that it uses the classes; ml-auto or mr-auto, instead of pull-right and pull-left. I can guess l is left and r is right. What's the meaning of m beside l and r? Is it margin? 回答1: It's short for: margin-left So ml-auto means margin-left: auto which aligns an element to the right. 来源: https://stackoverflow.com/questions/46160931/whats-the-meaning-of-ml-in-bootstrap-4

Bootstrap 4, bg-inverse not showing?

会有一股神秘感。 提交于 2019-12-30 02:07:12
问题 Trying to follow the navbar example in Bootstraps documentation, I have a problem where the background colour of the navbar doesn't get loaded. <nav class="navbar navbar-inverse bg-inverse"> <a class="navbar-brand" href="#">Navbar</a> </nav> I took a look in bootstrap.css and bg-inverse does not appear there. Am I supposed to create the colours myself, or am I doing something wrong? (I am working in an Angular project) 回答1: I think you are using Bootstrap beta version. Use the Alpha version .

Right aligned Bootstrap container which also aligns with default container

别来无恙 提交于 2019-12-29 09:51:30
问题 I've been trying to make a Bootstrap container which "spills out" onto the right hand side of the page but also aligns well with the standard Bootstrap container. So far I have tried duplicating the code for the standard container and altering the max-width values but I can't ever seem to make this align with the standard container. Here is what I have so far: width: 100%; padding-left: 15px; margin-left: auto; margin-top: 3rem; @media (min-width: 576px) { max-width: 675px; } @media (min

Bootstrap 4 Navbar keep section on right even when toggled

天大地大妈咪最大 提交于 2019-12-29 09:04:56
问题 I try to make the "login section" stay on the right corner even when the toggle is expanded. I have try to float the section but it did not work. Here is my code: <nav class="navbar navbar-expand-lg bg-dark navbar-dark fixed-top"> <div class="container"> <div class="navbar-header"> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#mymenu"> <span class="sr-only">toggle navigation</span> <span class="navbar-toggler-icon"></span> </button> <a href="#" class=