The Jade template is not rendering the page correctly as anticipated

I'm working with Node.js & express, using the Jade template for the view. My issue is that the Test text is currently hidden under the black navigation bar. How can I move it to the bottom, below the navbar? What am I missing in my code?

Here is the code for my jade layout:

html
    head
        title= title
        link(rel="stylesheet", href="bootstrap.min.css")
        link(rel='stylesheet', href='//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/css/bootstrap-theme.min.css')
        script(src='//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js')
    body 
        nav.navbar.navbar-inverse.navbar-fixed-top(role='navigation')
           .container
              .navbar-header
                button.navbar-toggle(data-toggle='collapse', data-target='#bs-example-navbar-collapse-1')
                      spansronly
                      span.icon-bar
                      span.icon-bar
                      span.icon-bar
               #bs-example-navbar-collapse-1.collapse.navbar-collapse
              ul.nav.navbar-nav
                li
                  a(href='/recipes/bbq')  Tab1
                li
                  a(href='/recipes/bbq')  Tab2
            div.container
                block content

My content:

extends layout

extends layout

block content .jumbtroon h1= 'Test'

I've placed the div.container with the same indentation level as the first div.

Rendered HTML code:

<html>
    <head>
        <title>

            Arrivals

        </title>
        <link href="bootstrap.min.css" rel="stylesheet"></link>
        <link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/css/bootstrap-theme.min.css" rel="stylesheet"></link>
        <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    </head>
    <body>
        <div>
            <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
                <div class="container">
                    <div class="navbar-header">
                        <button class="navbar-toggle" data-target="#bs-example-navbar-collapse-1" data-toggle="collapse">
                            <spansronly></spansronly>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                    </div>
                    <div id="bs-example-navbar-collapse-1" class="collapse navbar-collapse">
                        <ul class="nav navbar-nav">
                            <li>
                                <a href="/recipes/bbq">

                                     Tab1

                                </a>
                            </li>
                            <li>
                                <a href="/recipes/bbq">

                                     Tab2

                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
            </nav>
        </div>
        <div class="container">
            <div class="jumbtroon">
                <h1>

                    test

                </h1>
            </div>
        </div>
    </body>
</html>

In the image provided, you can see that the test text is located below the navbar.

Answer №1

When the navbar is fixed at the top of the page, the rest of the content will begin below it. If you need assistance with this, check out the Bootstrap documentation at http://getbootstrap.com/components/#navbar-fixed-top.

To create some space at the top of your page, simply include the following code in your custom.css file:

body {
    padding-top: 70px;
}

This will add padding to the top of your page as needed.

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 methods can be used to troubleshoot an issue of an AngularJS function not being called

I am facing an issue with a dynamic table I have created. The rows and action buttons are generated dynamically when the user clicks on the Devices accordion. However, there seems to be a problem with the function expandCollapseCurrent(). Whenever the use ...

How do I import NPM modules in Angular 5 without using @types?

Currently experimenting with Angular 5 and beginning a project from angular-cli. I am interested in incorporating a NPM module called J2M (https://github.com/kylefarris/J2M). During my research, I came across these two commands: npm install j2m --save npm ...

What is the best way to include a span within a select option element to display a flag beside each option?

I'm currently working on a dropdown menu that allows users to easily select their preferred language. I'm facing an issue with incorporating flags using https://github.com/lipis/flag-icon-css for each option. Can someone please assist me with thi ...

How can Firestore dates be monitored efficiently through cloud functions?

I am currently working on a NextJS application utilizing Firebase as my backend, specifically Firestore. Within my Firestore database, I have a collection named purchases where all user transactions are logged. The structure of the data is as follows: { ...

Mongoose fails to save due to an error stating "undefined id"

Having some trouble with the Mongoose save function... In my user model file: const mongoose = require('mongoose'); const Schema = mongoose.Schema; const User = mongoose.model('User', { name: Schema.Types.Mixed, gender: String, ...

What is the process for designing a dropdown box that showcases text details?

I am in the process of building an FAQ page and I am looking to incorporate a dropdown menu that lists all the frequently asked questions. When a user clicks on a question, I want the corresponding answer to be displayed without redirecting to a new page. ...

The HTML unit is unable to locate the form for unknown reasons. My suspicion is that it could be due to the presence of Angular

Struggling with using HTMLunit to login and upload a file. Successfully logged in but unable to locate the form, despite it being present on the HTML page. Here is the JAVA CODE snippet: public static void main(String[] args) { WebClient webClient = ...

Create circular shapes using the border-radius property

I've been experimenting with converting some divs using border radius and I've almost got it, but sometimes they end up looking like 'eggs' haha. Here is the CSS code I'm using: #div{ /*central div*/ position:absolute; t ...

When hovering over the background, it will enlarge but the text in front will remain the same size

As the user hovers over the image, the image enlarges. However, there is also some information that needs to be displayed in front of the image. This is my current implementation: .home-about-link { overflow: hidden; width: 100%; } .home-about { ...

Maintain HTML formatting when page is refreshed

I am new to HTML and JavaScript, and I'm trying to modify the JavaScript code below so that when I reload the page, it retains the most recent active tab instead of defaulting back to the first tab. Currently, if I click on the second tab for "Paris" ...

Trouble arises with the jQuery keydown function

Currently, I am encountering an issue with a straightforward jQuery code implementation. In addition to the problem description, I have included the HTML structure below, The current functionality works as expected in setting focus on the input field upo ...

Creating a personalized ESLint rule specifically for Redux reducers

Currently working with Redux and Redux Toolkit alongside ESLint presents a challenge. Sometimes, when adding my extraReducers, I find that I do not need both the state and action properties provided by Redux. As a result, ESLint throws an error in these c ...

A guide on customizing bar colors in a jqPlot stacked bar graph

Is there a way to customize the colors for individual bars in a jqPlot stacked bar chart? I've searched through examples, but they all seem to use the default colors. How can I explicitly set different colors for each bar? Here is the current code sn ...

Cheerio doesn't exit the loop prematurely

The Cheerio/JQuery documentation mentions that using return false in a loop should terminate it early. Below is the code snippet in question: "use strict"; let cheerio = require('cheerio'); let $ = cheerio.load('<a href="www.test.com"&g ...

Node.js code snippet for converting a base64 image data URL to a Blob

Can you help me with a simple task? I need to save an image blob in Nodejs from Angular. In Angular: $scope.upload = function (dataUrl, picFile) { Upload.upload({ url: 'http://test.dev:3000/register/user/uploads', data: { file: ...

What are some ways to execute multiple infinite loops simultaneously without causing interference in node.js?

I am attempting to run multiple parallel tasks (infinite loops) simultaneously in node.js without causing them to block each other. Here is my current approach: const test = async () => { let a = new Promise(async res => { while (true) { ...

Retrieve ALL information from a third-party API request with a limit of 1000 calls

Challenge: Implementation of a third-party API call using Node.JS. The API link restricts the number of users per call to 1000, with an option to retrieve the next set by passing parameters in the URL (?firstResult=1001&maxResults=1000&orderBy=NAME ...

An unexpected error occurred during Azure Pipeline's end-to-end testing: Chrome encountered an issue while attempting to launch and exited in an

I am currently in the process of executing my protractor test within an Azure pipeline. The following steps have been completed successfully: npm install webdriver update However, when running "npm run e2e," I encountered the error below (highlighted wit ...

Is react-particles-js still compatible for me to integrate?

I recently discovered that the package found here: https://www.npmjs.com/package/react-particles-js has been deprecated. Can I still utilize this package? The codes in question can be viewed at: https://codesandbox.io/s/particle-js-background-forked-woypk ...

Unifying flex and position:fixed

I'm having difficulties when it comes to displaying a modal dialog with a fixed position within a flex layout. The header and footer of the dialog need to be set in height, while the content section should have overflow with scrollbars. I chose the fl ...