diff options
author | Florian Lacreuse <florianlacreuse@users.noreply.github.com> | 2021-12-16 11:27:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-16 11:27:00 +0300 |
commit | d17801265e3562e5386b3445b84915618f5a81d7 (patch) | |
tree | 12f0860581689ddac50d7919453f5d9f7e8101a8 /site/content/docs/5.1/components/navbar.md | |
parent | 2d07383e32b7ad9ebad43e85ebdeb891dd0d105c (diff) |
Add sticky bottom utility (#35518)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Diffstat (limited to 'site/content/docs/5.1/components/navbar.md')
-rw-r--r-- | site/content/docs/5.1/components/navbar.md | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/site/content/docs/5.1/components/navbar.md b/site/content/docs/5.1/components/navbar.md index 8d245d10f9..57754e9b42 100644 --- a/site/content/docs/5.1/components/navbar.md +++ b/site/content/docs/5.1/components/navbar.md @@ -450,9 +450,9 @@ Use any of the responsive containers to change how wide the content in your navb ## Placement -Use our [position utilities]({{< docsref "/utilities/position" >}}) to place navbars in non-static positions. Choose from fixed to the top, fixed to the bottom, or stickied to the top (scrolls with the page until it reaches the top, then stays there). Fixed navbars use `position: fixed`, meaning they're pulled from the normal flow of the DOM and may require custom CSS (e.g., `padding-top` on the `<body>`) to prevent overlap with other elements. +Use our [position utilities]({{< docsref "/utilities/position" >}}) to place navbars in non-static positions. Choose from fixed to the top, fixed to the bottom, stickied to the top (scrolls with the page until it reaches the top, then stays there), or stickied to the bottom (scrolls with the page until it reaches the bottom, then stays there). -Also note that **`.sticky-top` uses `position: sticky`, which [isn't fully supported in every browser](https://caniuse.com/css-sticky)**. +Fixed navbars use `position: fixed`, meaning they're pulled from the normal flow of the DOM and may require custom CSS (e.g., `padding-top` on the `<body>`) to prevent overlap with other elements. {{< example >}} <nav class="navbar navbar-light bg-light"> @@ -486,6 +486,14 @@ Also note that **`.sticky-top` uses `position: sticky`, which [isn't fully suppo </nav> {{< /example >}} +{{< example >}} +<nav class="navbar sticky-bottom navbar-light bg-light"> + <div class="container-fluid"> + <a class="navbar-brand" href="#">Sticky bottom</a> + </div> +</nav> +{{< /example >}} + ## Scrolling Add `.navbar-nav-scroll` to a `.navbar-nav` (or other navbar sub-component) to enable vertical scrolling within the toggleable contents of a collapsed navbar. By default, scrolling kicks in at `75vh` (or 75% of the viewport height), but you can override that with the local CSS custom property `--bs-navbar-height` or custom styles. At larger viewports when the navbar is expanded, content will appear as it does in a default navbar. |