The Bootstrap Navbar-fixed-bottom div is covering up the JS rendered content due to an

The content on my main page container is being obscured by the content within this DIV:

<div class="navbar navbar-fixed-bottom"></div>

Below is the CSS from the GitHub project (bootstrap sass)

// Code to fix top/bottom navbars when screen real estate permits
.navbar-fixed-top,
.navbar-fixed-bottom {
  position: fixed;
  right: 0;
  left: 0;
  border-width: 0 0 1px;

  // Reset rounded corners
  @media (min-width: $grid-float-breakpoint) {
    border-radius: 0;
  }
}
.navbar-fixed-top {
  z-index: $zindex-navbar-fixed;
  top: 0;
}
.navbar-fixed-bottom {
  bottom: 0;
  margin-bottom: 0; 
}

The issue appears to be caused by dynamically rendered JS content loading after the initial page load.

Is there a solution without pre-determining the vertical height of the JS-generated content?

UPDATE

Here is the CSS for the container DIV above the navbar:

<!-- Long list of CSS properties omitted for brevity -->

Answer №1

By default, fixed navbars have a z-index of 1030, making them appear above most content at the bottom of the screen.

To address this issue, you can apply the following CSS as recommended in the bootstrap documentation: http://getbootstrap.com/components/#navbar-fixed-bottom

body { padding-bottom: 70px; }

However, if your page requires scrolling due to a large amount of content, the navbar may still overlap with the content until you reach the bottom. At that point, the padding added to the body should push the content above the navbar, which has a default height of 50px.

Alternatively, if you want the navbar at the bottom without floating, ensure it is rendered last in your HTML structure:

<body>
  <div class="container><!-- Content --></div>
  <footer><!-- Footer Content --></footer>
  <div class="navbar navbar-default" style="margin-bottom:0px;margin-left:0px;margin-right:0px;clear:both;"><!-- Navbar Code --></div>
</body>

It's worth noting that without enough content, the navbar may still appear above the bottom of the browser window, but it will align with the bottom of the content.

While there are other CSS hacks available, using them might conflict with bootstrap's styles and lead to additional rendering issues. One untested example is provided at:

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

What is the best way to display a variable from a function located outside of the public http folder in PHP?

I am attempting to create a registration form using Ajax. I have a script that calls a registration function located in an includes folder outside of the public html folder. The output of this function should be alerted, but when I click the button, the al ...

A helpful guide on using workbox to effectively cache all URLs that follow the /page/id pattern, where id is a

Looking at this code snippet from my nodejs server: router.get('/page/:id', async function (req, res, next) { var id = req.params.id; if ( typeof req.params.id === "number"){id = parseInt(id);} res.render('page.ejs' , { vara:a , va ...

Create an array of arrays within a loop using TypeScript

My application contains an object with dates and corresponding time arrays. The console log output is displayed below: 32: { 1514160000: Array [ 1200, 1500 ], 1514764800: Array [ 1200, 1500 ], 1515369600: Array [ 1200, 1500 ], 1515974400: Array [ 700, 12 ...

Tips on maintaining the consistent color of an active link until selecting a different link

Is it possible to make a link change color when clicked, and have that color stay until another link is clicked? How can I achieve this using the "active" attribute? I attempted it, but the link reverts back to its original color after clicking. &l ...

Steps for placing a figcaption above an image

Does anyone know how to position a figcaption at the bottom of an img so that it appears on top of the image with a transparent background? I've been having trouble making them the same width and getting the figcaption to sit on top of the image. Whe ...

I encountered a data discrepancy while attempting to link up with a weather API

This is my debut app venture utilizing node.js and express for the first time. The concept behind this basic application involves connecting to an external API to retrieve temperature data, while also allowing users to input their zip code and feelings whi ...

Error: Unable to locate module: Material-UI - Please check the path and try again

Encountering this error: Error message: Failed to compile ./node_modules/@material-ui/core/Modal/Modal.js Module not found: Can't resolve '@babel/runtime/helpers/builtin/assertThisInitialized' in 'C:\Users\rifat\ ...

Generate a nested array structure from an existing array using JavaScript

Currently, I have an array of numbers: [12345,345653,456356]. However, I need to convert this to a format like [[1232131],[234324],[67657]] in order to use a CSV react component tool that reads data in this specific structure. Does anyone have any ideas ...

Express Node.js Error: Address Information Syntax Issue

While developing my server using TypeScript for my Angular app to connect to, I encountered an issue when trying to run the code snippet below. It seems that Node.js or TS is not yet compatible with certain ES6 features like destructuring with AddressInfo, ...

A method for positioning each pair of <li> elements side by side

My goal is to arrange every pair of li elements next to each other (e.g. 0-9, A-B, C-D, ...). Currently, they are aligned one by one. <ul> <li class="alphabetRow"><a href="#" id="alpha_1" class="alphabet active" >0-9</a></li ...

Script on the server side fails to execute following validation of form

Hey there, I'm struggling with my signup form. I want to submit the form using ajax after completing validation. I've used a jQuery plugin for validation, but whenever I click on any field, the ajax request is automatically sent to the server and ...

Having trouble looping through an array of objects containing images in Javascript?

I am currently facing challenges with iterating through an array of objects that contain images. The array appears empty when logged in the console, but upon inspecting it in the console, I can see all the objects along with their iteration numbers. I have ...

Exploring ways to create simulated content overflow using react-testing-library

I have integrated material-table with material ui to develop a spreadsheet application. One of the features I have added is setting a maximum width of 50px for cells. If the content in a cell exceeds this width, it will display an ellipsis at the end of ...

Error encountered: MongoDB cast exception - nested subdocument

Check out this schema design: var messageSchema = new Schema({ receivers: [User], message: String, owner: { type: Schema.Types.ObjectId, ref: 'User' } }); var userSchema = new Schema({ name: String, photo: String }); var in ...

Problem with the hover functionality of the <li> tag

I'm having an issue with applying the hover property to the li element in the sidebar. The hover effect works, but the icon tag is not showing the hover effect. I want the icon to also show the hover effect along with the li's hover effect. Here ...

Struggling to traverse through intricate layers of nested objects in React and showcasing them without going crazy

Dealing with an API that returns data structured in deeply nested objects has been a challenging task. The goal is to extract specific data from these nested objects and then display them within a React project. Despite numerous attempts, finding a simple ...

leveraging the situation and a clever opening

Currently, I'm diving into mastering the proper utilization of context and hooks. Initially, everything worked flawlessly while all components remained within a single class. However, troubles arose when I segregated them into multiple classes leading ...

Having trouble verifying credentials to access the npm.fontawesome.com registry for installing pro packages

After following the instructions in font awesome documentation, I have globally configured my host. My current setup is: npm config set "@fortawesome:registry" https://npm.fontawesome.com/ npm config set "//npm.fontawesome.com/:_authToken" "${NPM_FONT_AW ...

What is the best way to add HTML tags both before and after a specified keyword within a string using JavaScript?

Imagine I have a string similar to this, and my goal is to add html tags before and after a specific keyword within the string. let name = "George William"; let keyword = "geo"; Once the html tags have been appended, the desired result should look like ...

What could be the reason for the image not showing up on react?

When I try to retrieve the base64 image from the server, it is not displaying properly. Here is the error message I am getting: GET data:image/png;base64,{base64 string} net::ERR_INVALID_URL <img src={data?.gameIcon} alt="" className={st ...