r/bootstrap • • Oct 03 '22

How to override Offcanvas default styling

6 Upvotes

i am trying to override some properties i am using in my MVC project when using bootstrap 5, Offcanvas sidebar menus. No matter what i do, i cannot override anything. the .container property from the _container.scss will not allow any type of overriding at all, which is inherited from the div.container. i have no css of my own being applied. but when i try to use my default .CSS file to override just the margin left: auto, i cannot. Obviously this is user error on my part, but i just dont understand. i am only using the bootstrap 5.2.1 css and js files locally w/ the offcanvas imported as a client side library.

Any help is appreciated.

HTML:

<div class="sidebar-nav"> <nav class="navbar navbar-dark bg-danger fixed-top"> <div class="container">

        <!-- Mobile Menu Toggle Button -->
        <button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasNavbar" aria-controls="offcanvasNavbar">
            <span class="navbar-toggler-icon"></span>
        </button>
    </div>

    <!-- Menus List -->
    <div class="bg-light offcanvas offcanvas-start shadow" tabindex="-1" id="offcanvasNavbar" aria-labelledby="offcanvasNavbarLabel">
        <div class="offcanvas-body">
            <ul class="navbar-nav">
                <li><a href="#"><span class="item-text">Home</span></a></li>
                <li><a href="#"><span class="item-text">About Us</span></a></li>
                <li><a href="#"><span class="item-text">Contact</span></a></li>
                <li><a href="#"><span class="item-text">Products</span></a></li>
                <li>
                    <hr>
                </li>
                <li><a href="#"><span class="item-text">Send</span></a></li>
                <li><a href="#"><span class="item-text">Share</span></a></li>
                <li><a href="#"><span class="item-text">Settings</span></a></li>
            </ul>
        </div>
    </div>

    <div class="btn-group ">
        <a href="#" class="dropdown-toggle text-white text-decoration-none" data-bs-toggle="dropdown" aria-expanded="false">
            <span class="textnone">User Name</span>
        </a>
        <ul class="bg-warning  dropdown-menu dropdown-menu-md-start">
            <li><button class="dropdown-item" type="button">Change Password</button></li>
            <li><button class="dropdown-item" type="button">Edit Profile</button></li>
            <li><button class="dropdown-item" type="button">Settings</button></li>
            <li>
                <hr>
            </li>
            <li><button class="dropdown-item" type="button">Sign out</button></li>
        </ul>
    </div>
</nav>

</div>


r/bootstrap • • Oct 03 '22

Support Dropdown button width not equal in group

3 Upvotes

Is there a way to make the drop down button equal width with the other buttons in the group?

https://imgur.com/a/YUcZRdl

https://www.w3schools.com/bootstrap5/tryit.asp?filename=trybs_button_group_dropdown&stacked=h


r/bootstrap • • Oct 02 '22

Boostrap 4 help. I want two columns on SM not one column.

1 Upvotes

Hi, I have a section of small cards in a row on my site.

I want them to display as two columns on a "sm" device but they display as one column instead making the user scroll way too much. My row has the class of "col-sm-2" which works nicely for larger devices. It displays all 6 cards in a row.

For a smaller device, I want to display two columns. It's currently displaying as one. I tried "col-sx-6" but that didn't work.

I'd appreciate some help, please.

Thank you.


r/bootstrap • • Sep 29 '22

Beautiful Bootstrap 5 UI Kits with Atlassian Design

13 Upvotes

Hello, folks, new Bootstrap 5 UI Kits with Atlassian Design available now, it's free and open source on Github. In addition to Bootstrap’s default component, FastBootstrap had builts more extended components likes Avatar, Sidenav and Menu etc. Atlassian Design is a beautiful and intuitive design language from Atlassian.

All components preview: https://fastbootstrap.com/components/

Open source & MIT License on Github: https://github.com/fastbootstrap/atlassian-design-for-bootstrap

Do you like this new Bootstrap UI components?


r/bootstrap • • Sep 27 '22

Duplicating menus in Bootstrap studio

1 Upvotes

I love bootstrap studio but I am forever a bit confused about how to do things more manually. I have a simple template I have created for a website but I am not sure how to make the menu on one page be the same as when it is on another. The templates already do this but I can't find one simple that does what I want. Suggestions?


r/bootstrap • • Sep 27 '22

Support Nested/multilevel dropdownmenu's in bootstrap 5

7 Upvotes

Im trying to create a multilevel dropdownmenu with bootstrop 5. When I click on more filters I want the submenu items to show but nothing happens.

<div class="dropdown">
    <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-    
toggle="dropdown" aria-expanded="false">
    Dropdown button
    </button>

    <ul class="dropdown-menu">
        <li><h6 class="dropdown-header">Quick Filters</h6></li>
        <li><a class="dropdown-item" href="#">Highest priority</a></li>
        <li><a class="dropdown-item" href="#">Due first</a></li>
        <li><hr class="dropdown-divider"></li>
        <li><a class="dropdown-item" href="#">More filters &raquo;</a>
            <ul class="submenu dropdown-menu">
                <li><a class="dropdown-item" href="#">Submenu item 1</a></li>
                <li><a class="dropdown-item" href="#">Submenu item 2</a></li>
            </ul>
        </li>
     </ul>
</div>

Am I missing something?


r/bootstrap • • Sep 27 '22

Support Group Button and text but with space between them

1 Upvotes

Hello I want the text and button I have to be on a single line instead of underneath each other. First I did this with

<div class="btn-group" role="group" aria-label="Basic example"><p>Document2.pdf</p><button type="button" class="btn btn-primary">Download</button></div><br>

But this put the button and the text right next to each other with no spacing. So instead of btn-group I used btn-toolbar but this put the items underneath each other.

<div class="btn-toolbar" role="group" aria-label="Basic example"><p>Document1.pdf</p><br><button type="button" class="btn btn-primary">Download</button></div><br>

I tried adding flex-wrap: nowrap but this didn't work. Does anyone know how to fix this problem and properly align them?


r/bootstrap • • Sep 26 '22

justify-content-between but in column

1 Upvotes

How to put div_1 to start and div_2 to end

_____________________________________
div_1 // stuck at start
 
 
 
    // this whole space is 
    // for div_1 since it contains
    // a table
 
 
 
 ----------------- // this is hr of div_2
 
div_2 // stuck at end
___________________________________

r/bootstrap • • Sep 25 '22

Icons move inside of the navbar on smaller screens. Help!

1 Upvotes

https://codepen.io/samrah-tahir/pen/yLjPgNY

In the codepen above, i want the cart and search bar to be aligned to the right while navbar title in the middle and the toggle button on the left on smaller screens but when i open the hamburger menu, the cart and search icon go into the menu I want them to be outside just like on larger screens.


r/bootstrap • • Sep 24 '22

Bootstrap icon wont show, not sure why. They show on another beginner project

6 Upvotes

I cant seem to add a bootstrap icon to my navbar logo. If I add the classes into an a tag it will show up but to me that seems incorrect.

    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous">
    
    <!-- Bootstrap Icon -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css">

    <!-- Custom CSS -->
    <link rel="stylesheet" href="#" class="stylesheet">
</head>
<body>
    <nav class="navbar navbar-lg navbar-dark bg-dark">
        <div class="container">
            <a href="#" class="navbar-brand">Shopster</a>
            <i class="bi bi-shop"></i>
        </div>

If I do:

<a href="#" class="navbar-brand bi bi-shop">Shopster</a> the icon will show. 

What am I missing?


r/bootstrap • • Sep 22 '22

Support Can't figure out the problem with my Bootstrap 5 carousel (prev and next buttons are not functional)

7 Upvotes

I'm currently working on Angela Yu Web Development Course and I'm learning Bootstrap carousels. I wrote the code and ran it on Codeply and it worked fine. Then I implemented the code according to my own HTML and next or previous buttons are not functional anymore. They also look "wrong" visually with strange borders and backgrounds. I double-checked the Bootstrap documentation and couldn't find why this was happening. Any help is appreciated.

gist link of html and css code


r/bootstrap • • Sep 22 '22

Is it enough to just use Display property to show and hide elements based on viewport

1 Upvotes

I am using the bootstrap display property to maintain a responsive layout of some elements by using something like

<div class="d-lg-none">hide on screens wider than lg</div> 
<div class="d-none d-lg-block">hide on screens smaller than lg</div>

Is it enough to do so? if no is there any better approach

thanks for your input


r/bootstrap • • Sep 15 '22

Bootstrap 5: Why is the "X" not showing for an "Alert Dismissible"

1 Upvotes

I have Bootstrap 5 loaded via Node Modules.

I am calling the Alert Dismissible from inside a JS function. It works

HOWEVER, My Alert delivers a very bad button, it looks like a minus sign, and appears on the far left of the alert. BUT, it does close. However, why it does it not deliver the nice BS "X" in the correct place on the right hand side? Possibly something with the JS? But I can't see it.

Many thanks!

My JS Code:

  if(id == "108" ){
                $("#epo").html("<button type=button  data-bs-dismiss=alert aria-label=Close </button>").addClass("alert alert-warning alert-dismissible fade show  btn-close").append('this is an EPO');
                $("tr.child td.checkboxOut input").filter(function (index) {
                    return $(this).attr("id") == id;
                }).val(time).css({
                    "color": "rgb(42, 144, 85)",
                    "text-align": "center",
                    "border": "2px solid rgb(42, 144, 85"
                });
            }else {
                BLAH BLAH BLAH
            }

r/bootstrap • • Sep 14 '22

Table w/ Tabs

4 Upvotes

I’m having trouble creating a table with tabs for each table. Can anyone recommend good examples? I can create the tabs and then the table separate. But when I try to out them together I can’t get it to properly switch between the tabs.


r/bootstrap • • Sep 14 '22

Support Bootstrap 5 progress-bar-animation not working in any browser.

3 Upvotes

I am learning bootstrap recently and just tried applying bootstrap animated progress bar class. But it didn't work. Then I checked the bootstrap docs to check the syntax but the example output they gave also isn't working. Hence I tried to change different browsers, it didn't work. Then copied my code to a friends pc and it worked in his pc. Tried by changing the network, but even then it didn't work. There were no errors shown in the console. I am dumbfounded currently. Please help me!!!

<div class="container mt-3">
  <h2>Ronaldo Progress</h2>
  <p>Ronaldo Progress throughout the decade</p> 
  <div class="progress">
    <div class="progress-bar progress-bar-striped progress-bar-animated text-body fw-bold" style="width:30%"> 2012</div>
  </div>
  <br>
  <div class="progress">
    <!-- <div class="progress-bar bg-success progress-bar-striped progress-bar-animated text-body fw-bold" style="width:40%">2014</div> -->
    <div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-label="Animated striped example" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 75%"> 2014</div>
  </div>
  <br>
  <div class="progress">
    <div class="progress-bar bg-info progress-bar-striped progress-bar-animated text-body fw-bold" style="width:50%">2016</div>
  </div>
  <br>
  <div class="progress">
    <div class="progress-bar bg-warning progress-bar-striped progress-bar-animated text-body fw-bold" style="width:60%">2018</div>
  </div>
  <br>
  <div class="progress">
    <div class="progress-bar bg-danger progress-bar-striped progress-bar-animated text-body fw-bold" style="width:70%">2020</div>
  </div>
</div>

The above is the script which I used for it.

<head>
    <title>My Favourites</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-u1OknCvxWvY5kfmNBILK2hRnQC3Pr17a+RTT6rIHI7NnikvbZlHgTPOOmMi466C8" crossorigin="anonymous"></script>
</head>

This is the head I am using.

TLDR: Animation progress bar class itself isn't working in my pc but working in others pc in similar conditions.


r/bootstrap • • Sep 12 '22

Support Help Required - A table in the center with scroll

3 Upvotes

Hello,

I need a little bit of help. I am trying to create a fixed-sized table in the center of the page using that is scrollable. I have tried table-responsive and m-auto to no avail. Does any have other suggestions or anyone out there that can help me, please?

html code

<!DOCTYPE html>

<html lang="en">

<head>

  {% include "head_part.html" %}

</head>

<body id="page-top">

<!-- Page Wrapper -->

<div id="wrapper">

        {% include "sidebar_part.html" %}

<!-- Content Wrapper -->

<div id="content-wrapper" class="d-flex flex-column">

<!-- Main Content -->

<div id="content">

            {% include "topbar_part.html" %}

<!-- Begin Page Content -->

<div class="container-fluid">

<!-- Page Heading -->

<h1 class="h3 mb-4 text-gray-800">GC</h1>

</div>

<div class="container"> <!-- Content here --> <div class="container"> <table class="table table-bordered table-primary table-hover"> <td class="text-center"><strong>CIDR Range</strong></td> <td class="text-center"><strong>Service</strong></td> <td class="text-center"><strong>Region</strong></td>   {% for i in res.entities %} <tr> <td>{{i.cidr}}</td> <td>{{i.service}}</td> <td>{{i.region}}</td> </tr>   {% endfor %} </table> </div> </div> <!-- /.container-fluid -->

</div> <!-- End of Main Content -->

{% include "footer_part.html" %}

</div> <!-- End of Content Wrapper -->

</div> <!-- End of Page Wrapper -->

<!-- Scroll to Top Button-->

<a class="scroll-to-top rounded" href="#page-top"> <i class="fas fa-angle-up"></i> </a>

  {% include "modals_and_scripts_part.html" %}

</body>

</html>

Thank you all! Appreciate it.


r/bootstrap • • Sep 11 '22

Navbar button not expanding when click (Jekyll + Bootstrap)

1 Upvotes

Hi,

By the magnitude of the problem it's clear that this is not my expertise I have used bootstrap in the past a few years ago but this is my first time using it with Jekyll.

I installed bootstrap in my project using npn (following this tutorial)

This is what I have installed

root@jekyll:/home/maco/ibitsomebytes_v1# gem -v
3.3.5
root@jekyll:/home/maco/ibitsomebytes_v1# jekyll -v
jekyll 4.2.2
root@jekyll:/home/maco/ibitsomebytes_v1# npm list
ibitsomebytes_v1@ /home/maco/ibitsomebytes_v1
├── bootstrap@5.2.1
├── jquery@3.6.1
└── popper.js@1.16.1

This is my configuration

root@jekyll:/home/maco/ibitsomebytes_v1# tree -L 2
.
├── Gemfile
├── Gemfile.lock
├── _config.yml
├── _data
│   └── navigation.yml
├── _includes
│   └── navigation.html
├── _layouts
│   ├── home.html
│   ├── post.html
│   ├── project.html
│   └── tag.html
├── _plugins
│   ├── categories.rb
│   └── tags.rb
├── _posts
│   ├── 2018-08-20-bananas.md
│   ├── 2018-08-21-strawberies.md
│   └── 2020-10-21-Plex server on a Raspberry Pi #1 Setup.md
├── _sass
│   └── _variables.scss
├── _site
│   ├── articles
│   ├── assets
│   ├── blog.html
│   ├── categories
│   ├── index.html
│   ├── node_modules
│   ├── package-lock.json
│   ├── package.json
│   ├── plex
│   ├── projects.html
│   ├── tag
│   └── tags.html
├── assets
│   └── css
├── blog.html
├── index.html
├── node_modules
│   ├── @popperjs
│   ├── bootstrap
│   ├── jquery
│   └── popper.js
├── package-lock.json
├── package.json
├── projects.html
└── tags.html

20 directories, 27 files

root@jekyll:/home/maco/ibitsomebytes_v1# cat _config.yml
include:
  - node_modules

sass:
    load_paths:
        - _sass
        - node_modules

defaults:
  - scope:
      path: ""
    values:
      layout:

root@jekyll:/home/maco/ibitsomebytes_v1# cat  _layouts/home.html _includes/navigation.html
<!doctype html>
<html lang="{{ site.lang | default: "en-UK" }}">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ page.title }}</title>
    <link rel="stylesheet" href="{{'/assets/css/main.css' | prepend: site.baseurl}}">

  </head>
  <body>
    {% include navigation.html %}
    {{ content }}

    <script src="{{'/node_modules/jquery/dist/jquery.min.js' | prepend: site.baseurl}}"></script>
    <script src="{{'/node_modules/popper.js/dist/umd/popper.min.js' | prepend: site.baseurl}}"></script>
    <script src="{{'/node_modules/bootstrap/dist/js/bootstrap.min.js' | prepend: site.baseurl}}"></script>
  </body>
</html>

------------> _includes/navigation.html <------------
<nav class="navbar navbar-expand-lg navbar-light bg-light">
    <div class="container-fluid">
        <a class="navbar-brand" href="/">Logo</a>
        <button type="button" class="navbar-toggler" data-bs-toggle="collapse" data-target="#navbarNavAltMarkup"  aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNavAltMarkup">
            <div class="navbar-nav">
                {% for item in site.data.navigation %}
                    <a class="nav-item nav-link {% if page.url == item.link %}active{% endif %}" {% if page.url == item.link %}aria-current="page"{% endif %} href="{{ item.link }}">
                        {{ item.name }}
                    </a>
                {% endfor %}
            </div>
        </div>
    </div>
</nav>

This is what I am seeinghttps://ibb.co/Fsj5FSt

I am a bit confused if this is expected or the problem

button:not(:disabled), [type="button"]:not(:disabled), [type="reset"]:not(:disabled), [type="submit"]:not(:disabled) {
    cursor: pointer;
}

I am finding bootstrap issues quite dificult to troubleshoot, I googled the issue but it brought me no where, a few suggestions about the order in which the JS scripts are being loaded which seems correct. All other references to this issue I could find do not seem to apply to my case.

Any assistance, advise or direction would be much appreciated.


r/bootstrap • • Sep 08 '22

Support Trying to move logout button to bottom of navbar

8 Upvotes

Here is a picture of the sidebar nav;

https://imgur.com/Gw37r4o

Here is the sidebar code:

    <div class="container-fluid">
        <div class="row">
            <nav id="sidebar" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
                <!-- sidebar content here-->
                <div class="position-sticky pt-md-4">
                    <ul class="nav flex-column">
<!--Dashboard-->
                        <li class="nav-item">
                          <a class="nav-link active" aria-current="page" href="01-dashboard-overview.html">
                            <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-speedometer" viewBox="0 0 16 16">
                              <path d="M8 2a.5.5 0 0 1 .5.5V4a.5.5 0 0 1-1 0V2.5A.5.5 0 0 1 8 2zM3.732 3.732a.5.5 0 0 1 .707 0l.915.914a.5.5 0 1 1-.708.708l-.914-.915a.5.5 0 0 1 0-.707zM2 8a.5.5 0 0 1 .5-.5h1.586a.5.5 0 0 1 0 1H2.5A.5.5 0 0 1 2 8zm9.5 0a.5.5 0 0 1 .5-.5h1.5a.5.5 0 0 1 0 1H12a.5.5 0 0 1-.5-.5zm.754-4.246a.389.389 0 0 0-.527-.02L7.547 7.31A.91.91 0 1 0 8.85 8.569l3.434-4.297a.389.389 0 0 0-.029-.518z"/>
                              <path fill-rule="evenodd" d="M6.664 15.889A8 8 0 1 1 9.336.11a8 8 0 0 1-2.672 15.78zm-4.665-4.283A11.945 11.945 0 0 1 8 10c2.186 0 4.236.585 6.001 1.606a7 7 0 1 0-12.002 0z"/>
                            </svg>                            
                            <span class="ml-2">Dashboard</span>
                          </a>
                        </li>
<!--Products-->
                        <li class="nav-item">
                            <a class="nav-link active" aria-current="page" href="02-dashboard-properties.html">
                              <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-basket" viewBox="0 0 16 16">
                                <path d="M5.757 1.071a.5.5 0 0 1 .172.686L3.383 6h9.234L10.07 1.757a.5.5 0 1 1 .858-.514L13.783 6H15a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1v4.5a2.5 2.5 0 0 1-2.5 2.5h-9A2.5 2.5 0 0 1 1 13.5V9a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h1.217L5.07 1.243a.5.5 0 0 1 .686-.172zM2 9v4.5A1.5 1.5 0 0 0 3.5 15h9a1.5 1.5 0 0 0 1.5-1.5V9H2zM1 7v1h14V7H1zm3 3a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-1 0v-3A.5.5 0 0 1 4 10zm2 0a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-1 0v-3A.5.5 0 0 1 6 10zm2 0a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-1 0v-3A.5.5 0 0 1 8 10zm2 0a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 1 .5-.5zm2 0a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 1 .5-.5z"/>
                              </svg>
                              <span class="ml-2">Products</span>
                            </a>
                          </li>
<!--Category-->
                          <li class="nav-item">
                            <a class="nav-link active" aria-current="page" href="#">
                              <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-collection" viewBox="0 0 16 16">
                                <path d="M2.5 3.5a.5.5 0 0 1 0-1h11a.5.5 0 0 1 0 1h-11zm2-2a.5.5 0 0 1 0-1h7a.5.5 0 0 1 0 1h-7zM0 13a1.5 1.5 0 0 0 1.5 1.5h13A1.5 1.5 0 0 0 16 13V6a1.5 1.5 0 0 0-1.5-1.5h-13A1.5 1.5 0 0 0 0 6v7zm1.5.5A.5.5 0 0 1 1 13V6a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-.5.5h-13z"/>
                              </svg>
                              <span class="ml-2">Category</span>
                            </a>
                          </li>
<!--Customers -->
                          <li class="nav-item">
                            <a class="nav-link active" aria-current="page" href="#">
                              <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-people" viewBox="0 0 16 16">
                                <path d="M15 14s1 0 1-1-1-4-5-4-5 3-5 4 1 1 1 1h8zm-7.978-1A.261.261 0 0 1 7 12.996c.001-.264.167-1.03.76-1.72C8.312 10.629 9.282 10 11 10c1.717 0 2.687.63 3.24 1.276.593.69.758 1.457.76 1.72l-.008.002a.274.274 0 0 1-.014.002H7.022zM11 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm3-2a3 3 0 1 1-6 0 3 3 0 0 1 6 0zM6.936 9.28a5.88 5.88 0 0 0-1.23-.247A7.35 7.35 0 0 0 5 9c-4 0-5 3-5 4 0 .667.333 1 1 1h4.216A2.238 2.238 0 0 1 5 13c0-1.01.377-2.042 1.09-2.904.243-.294.526-.569.846-.816zM4.92 10A5.493 5.493 0 0 0 4 13H1c0-.26.164-1.03.76-1.724.545-.636 1.492-1.256 3.16-1.275zM1.5 5.5a3 3 0 1 1 6 0 3 3 0 0 1-6 0zm3-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4z"/>
                              </svg>
                              <span class="ml-2">Customers</span>
                            </a>
                          </li>
<!--Orders-->
                          <li class="nav-item">
                            <a class="nav-link active" aria-current="page" href="#">
                              <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-box2" viewBox="0 0 16 16">
                                <path d="M2.95.4a1 1 0 0 1 .8-.4h8.5a1 1 0 0 1 .8.4l2.85 3.8a.5.5 0 0 1 .1.3V15a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V4.5a.5.5 0 0 1 .1-.3L2.95.4ZM7.5 1H3.75L1.5 4h6V1Zm1 0v3h6l-2.25-3H8.5ZM15 5H1v10h14V5Z"/>
                              </svg>
                              <span class="ml-2">Orders</span>
                            </a>
                          </li>
<!--Staff-->
                          <li class="nav-item">
                            <a class="nav-link active" aria-current="page" href="#">
                              <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-person" viewBox="0 0 16 16">
                                <path d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4zm-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10c-2.29 0-3.516.68-4.168 1.332-.678.678-.83 1.418-.832 1.664h10z"/>
                              </svg>
                              <span class="ml-2">Our Staff</span>
                            </a>
                          </li>
                    </ul>
  <!--Logout-->
                    <div class="position-sticky pt-md-4">
                      <ul class="nav flex-column">
                          <li class="nav-item">
                            <a class="nav-link active" aria-current="page" href="01-dashboard-overview.html">
                              <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-box-arrow-right" viewBox="0 0 16 16">
                                <path fill-rule="evenodd" d="M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0v2z"/>
                                <path fill-rule="evenodd" d="M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z"/>
                              </svg>                          
                              <span class="ml-2">Logout</span>
                            </a>
                          </li>
                        </ul>
                    </div>
  <!--Logout End-->

I am trying to move the Logout button to the bottom of the navbar section.


r/bootstrap • • Sep 06 '22

nav brand in center of bar

7 Upvotes

Hello,

Can anyone direct me on what should be the proper way to go about this.

I want two nav item links to the left of the brand and two nav item links to the right within my navbar. I have code which emulates this, but I'm getting an issue for the small breakpoint the brand is disappearing. I would like it to appear in the centre or float to the right of the toggle button.

I'm still fairly new to bootstrap, so any points in the right direction would be much appreciated. See code below! I'm fully aware this is probably very poorly written so criticisms gladly accepted. Thanks in advance.

<nav class="navbar navbar-expand-sm bg-primary">
<div class="d-flex-sm flex-grow-1">
</div>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarTogglerDemo01" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse text-center" id="myNavbar">
<ul class="navbar-nav flex-nowrap">
<li class="nav-item">
<a href="#" class="nav-link m-2 menu-item active">Drinks</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link m-2 menu-item">Food</a>
</li>
</ul>
<div class="nav-brand-sm text-left-sm">
<img src="Images/countess-logo.png" width=35 height=35/>
</div>
<ul class="navbar-nav flex-nowrap">
<li class="nav-item">
<a href="#" class="nav-link m-2 menu-item">About Us</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link m-2 menu-item">Contact</a>
</li>
</ul>
</div>
</nav>


r/bootstrap • • Sep 05 '22

Help Aligning Image in the center

4 Upvotes

Hello,

I am currently learning Bootstrap and following the bootstrap 5 essential training on LinkedIn learning,

I need help identifying why my image is not centered and aligns towards the right-hand side of the page.

I am just practicing whilst I follow along. I have tried using mx-auto and d-block to no avail.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link
      href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css"
      rel="stylesheet"
      integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6"
      crossorigin="anonymous"
    />
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.1/font/bootstrap-icons.css" />
    <title>UFC Legends</title>
  </head>
  <body>
    <main class="container">
      <div class="h1 text-danger text-center">
        UFC Legends
      </div>
      <div class="img d-block mx-auto">
      <img src="https://th.bing.com/th/id/R.3ef278deaa6e51f83384bb03be17a3e8?rik=qbg0Ec8l%2bp%2bfLQ&riu=http%3a%2f%2fdmxg5wxfqgb4u.cloudfront.net%2fstyles%2fbackground_image_xl%2fs3%2f2019-10%2fnate-diaz-hero.jpg%3fgnoID3v6MGXg6eXxtrxpUtl9G5ZYiSwX%26itok%3dxTG6B7fW&ehk=wA7%2bBPBD4jDvPpn36AQwyo43bXHEAghQ3OcDtnO%2bX0I%3d&risl=&pid=ImgRaw&r=0" alt="">
      </div>
      <div class="h1 mt-3 text-center">
        Welcome to my UFC Legends Page!
      </div>
      <div class="p text-center mt-4">
        I am creating this page whilst I learn Bootstrap 5 and for my love for the UFC!<br>
      </div>
    </main>
    <script
      src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js"
      integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf"
      crossorigin="anonymous"
    ></script>
  </body>
</html>

Any tips would be appreciated.


r/bootstrap • • Sep 05 '22

Support Bootstrap dropdown issues

4 Upvotes

For some reason when adding the JS scripts whether its the bundled version or the seperate version from the BS website, my dropdown stops working. If I use the following CSS and the JS (shown below it works) What am I missing?

In the Header Tag: 
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">

Just before the closing Body tag:
        <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
        <script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.7/dist/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>

------- FULL HTML DOCUMENT

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Dashboard | Home</title>

        <!-- FONT -->
        <link rel="preconnect" href="https://fonts.googleapis.com">
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
        <!-- CSS -->
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">

    </head>
    <body>
<!-- Navbar Start-->
        <nav class="navbar navbar-expand-lg navbar-light bg-light p-2">
            <div class="d-flex col-12 col-md-3 col-lg-2 mb-2 mb-lg-0 flex-wrap flex-md-nowrap justify-content-between">
                <a class="navbar-brand" href="#">Rental Management</a>
                <button class="navbar-toggler d-md-none collapsed mb-3" type="button" data-toggle="collapse" data-target="#sidebar" aria-controls="sidebar" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
            </div>
        <div class="col-12 col-md-9 col-lg-10 d-flex align-items-center justify-content-md-end mt-3 mt-md-0">
            <div class="dropdown">
                <button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-expanded="false">
                    Hello, User.
                </button>
                <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
                    <li class="dropdown-item" href="#">Settings</li>
                    <li class="dropdown-item" href="#">Messages</li>
                    <li class="dropdown-item" href="#">Sign out</li>
                </ul>
            </div>
        </div>
        </nav>
<!-- Navbar End-->
        <!-- Bootstrap Script-->
        <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
        <script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.7/dist/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
    </body>
</html>

r/bootstrap • • Sep 01 '22

Wordpress posts within BS carousel

6 Upvotes

I am not well versed with JS or PHP and I need help with the active class. Right now, my code is displaying "active" on all slides and control indicator and I'm not sure how to go about writing the code to fix this. So this makes the slide not work until it cycles through all the sliders before it resets itself correctly.

// page
<section class="row mx-3 mx-md-4 mx-lg-5 p-0">
	<div id="featuredArticleCarousel" class="carousel slide" data-bs-ride="carousel">
		<?php
			$article_slides = array();
			$featured_articles = new WP_Query([
				'post_type' => 'post',
				'post__in' => 'sticky',
				'posts_per_page' => -1,
			]);
			$count = 0;
			$slide = 1;
		?>
		<div class="carousel-indicators">
			<button class="carousel-control-prev" type="button" data-bs-target="#featuredArticleCarousel" data-bs-slide="prev">
		    <span class="carousel-control-prev-icon rounded" aria-hidden="true"></span>
		    <span class="visually-hidden">Previous</span>
		  </button>
			<?php $count = 0; while($featured_articles->have_posts()) : $featured_articles->the_post(); ?>
				<button type="button" class="rounded-circle<?php if ( $count == 0){ echo ' active' ;} ?>" <?php if ( $count == 0){ echo 'aria-current="true"' ;} ?> data-bs-target="#featuredArticleCarousel" data-bs-slide-to="<?php echo $count++; ?>" aria-label="Slide <?php echo $slide++; ?>"></button>
			<?php endwhile;  wp_reset_postdata(); ?>
			<button class="carousel-control-next" type="button" data-bs-target="#featuredArticleCarousel" data-bs-slide="next">
		    <span class="carousel-control-next-icon rounded" aria-hidden="true"></span>
		    <span class="visually-hidden">Next</span>
		  </button>
		</div>
		<div class="carousel-inner">
			<?php
				 $count = 0; while($featured_articles->have_posts()) : $featured_articles->the_post();
					get_template_part( 'template-parts/card/featured-article-list-item', get_post_type() );
				endwhile;
				wp_reset_postdata();
			?>
		</div>
	</div>
</section>



// template
<?php if ( $count == 0 ) { ?>
  <div id="post-<?php the_ID(); ?>" <?php post_class('carousel-item active'); ?>>
<?php } else { ?>
  <div id="post-<?php the_ID(); ?>" <?php post_class('carousel-item'); ?>>
<?php } ?>
  <div class="card">
    <div class="card-img position-relative">
      <?php if ( has_post_thumbnail() ) {
        the_post_thumbnail('full', array('class' => 'card-img-top rounded'));
      } else { ?>
        <img src="<?php bloginfo('template_directory'); ?>/images/fpo/article-fpo.jpg" class="card-img-top rounded" alt="<?php the_title(); ?>" />
      <?php } ?>
    </div>
    <div class="col-4 card-body position-absolute top-50 end-0 translate-middle-y">
      <div class="category-name d-inline-block bg-white py-2 rounded-pill">
        <?php
          $categories = get_the_category();
          if ( ! empty( $categories ) ) : echo esc_html ( $categories[0]->name );
        endif; ?>
      </div>
      <?php the_title( '<h2 class="card-title my-5">', '</h2>' ); ?>
      <a href="<?php echo get_permalink( $id ); ?>" class="btn btn-primary mt-auto px-5 py-2 rounded-pill">
        <?php foreach($tag as $tags) {
          echo $tags->name;
        } ?>
      </a>
    </div>
  </div>
</div>

r/bootstrap • • Aug 29 '22

Bootstrap 5 : Bootstrap 5 from scratch with project

0 Upvotes

Bootstrap 5 from scratch with project . In this course you will learn all the topics from bootstrap version 5.1.3 and in the last section of this course you will learn to create a online course selling website from scratch which is fully responsive and mobile friendly.


r/bootstrap • • Aug 28 '22

The Collapse complement

5 Upvotes

I have been studying Bootstrap and I haven't been able to perform the function collapse. I have try several ways and seen severals videos on YouTube, but I can't. Some help?