I noticed that when I am scrolling through my website, the navigation bar becomes hidden due

I'm facing an issue where my navbar disappears when I try to scroll to the second page of the website. Can anyone explain why this is happening, or provide a tutorial or course that I can reference?

index.html

This is the index.html file where I've written all the code for my project. I have also used FontAwesome for icons.

...

Answer №1

Hey there, could you take a look at this code snippet? Adding background-color to the .fixed-top class and padding-top to the .header-section class should do the trick.

Feel free to refer to this link for more details: https://jsfiddle.net/yudizsolutions/yu1azfed/2/

.header-section {
  padding-top: 70px;
}

.fixed-top {
  background-color: #000;
}
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" type="text/css" href="css/style.css">
  <link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous" />
  <link rel="preconnect" href="https://fonts.gstatic.com">
  <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@600&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e0828f8f949394928190a0d4ced6ced0">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
  <!-- <link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet"> -->
  <!-- <link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet"> -->
  <title>Website</title>
</head>

<body>
 
  <!-- rest of the code goes here -->
 
</body>

</html>
html css bootstr

Answer №2

nav{ position: fixed; } Don't forget to include this in your style sheet!

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

Uploading Images Dynamically with Ajax and jQuery in PHP

[Resolved Previous Issue] Recently, I obtained an image upload script that utilizes Ajax and jQuery. My goal is to restrict the maximum number of uploads to just 8 images. Any suggestions or advice would be greatly appreciated. Source of Download: ...

Using a <button> tag instead of a <div> inside of a <button> is not allowed, as clickable divs are typically frowned upon. What

I'm currently developing a React App that functions as a calendar, allowing users to click on specific days displayed as large squares to view information for that day. For accessibility purposes, I initially considered using <button> elements b ...

The Struggle with Bootstrap Accordion

I'm currently in the process of learning bootstrap. I copied the code for the 'Flush' Accordion from the bootstrap docs, but my version looks completely off. Despite linking the CSS stylesheet and JS Bundle, it doesn't seem to align pro ...

What causes Django to detect errors within comment blocks in templates?

There are times when Django encounters an error in a template. I prefer to comment out the line for debugging purposes, but Django continues to detect the error even within the comment. For instance, this particular link triggers an error because the url ...

Issues with inconsistent behavior of the select option in a form

Having some trouble with my form code. When I checked the web page, there seems to be an extra element that shouldn't be there. You can view the webpage https://i.sstatic.net/pu4ef.jpg. Inspecting it in browser developer mode, I found this extra eleme ...

Clicking the submit button on a PHP contact form will prompt the opening of

My project involves creating a custom contact form using html5 and php. I have successfully designed the form as per my requirements and now I am working on validating the entered values in the fields. To check if everything is functioning correctly, I am ...

I have to define a specific identifier in Django so that I can easily incorporate it into Bootstrap later on

I am working on creating a portfolio in Django. I have a section in my HTML code that connects to my jobs list in Django using {% for ... %} in order to display images, summaries, and titles of my projects. However, there is an ID within this div that refe ...

Bootstrap CSS allows for easy closing of modals

Having trouble with the Twitter Bootstrap CSS causing my animation to open with a fade and immediately close. Not sure why this is happening, can anyone provide assistance? Update: Turns out, the bootstrap.css file already has Modals implemented. Using bo ...

Is there a way to apply two distinct styles to a single component on a webpage?

Currently, I am in the process of developing a web application using Node JS, React, and Bootstrap. Within the application, I have implemented a main menu and a secondary menu using tabs. I have successfully defined a style for the main menu, but I am faci ...

"What is the significance of the .default property in scss modules when used with typescript

When dealing with scss modules in a TypeScript environment, my modules are saved within a property named default. Button-styles.scss .button { background-color: black; } index.tsx import * as React from 'react'; import * as styles from ' ...

I'm encountering an issue with the "z-index: -1" property in React

After creating a form placed alongside buttons, I encountered an issue where the form overlaps the buttons and prevents them from being clicked. Despite setting the z-index to -1, it seems that the form remains clickable even when not visible. Research ind ...

To access an RSS feed, use Google Chrome as your browser

I am struggling with my .php script that generates an RSS-Feed on-the-fly. My goal is to attach a .css stylesheet to this script so that browsers lacking a built-in RSS-viewer can properly display the feed. I achieved this using the following code snippet ...

The svg line is drawn with a width that is half of the specified width

I am looking to create a horizontal line that is 10px wide. I tried using the code below <svg width="500" > <line x1="100" x2="460" y1="0" y2="0" stroke="red" stroke-width="10px&qu ...

Background image in full view

Can anyone help me create a full background on my page? I'm not sure if there's an issue with my code. https://i.sstatic.net/vdOVs.png This is my code: return ( <div className="bg welcome container text-center" style={{ ...

Obtaining <script> and <div> elements from Plotly with Python

Seeking advice on the best way to extract <script> and <div> tags from the HTML output generated by Plotly's offline client. Ideally looking for a built-in method, but open to creating a custom solution if needed. I have experience with B ...

Modifying the color of a specific node in jstree

I am attempting to modify the background color of the node I have selected in jstree. $('#syncrep').jstree({ 'core' : { 'data' : repository ...

Extensive content within the v-autocomplete field

I am trying to use the v-autocomplete component to display the entire text of the selected item. On initial selection, everything displays correctly: https://i.sstatic.net/LFZ2c.png However, once it is chosen, only a portion of the text is shown, leavin ...

Choose a checkbox by targeting a specific column value with XPath

While automating the testing with Selenium, I encountered an issue related to selecting a checkbox in a table row. To resolve this problem, I turned to XPath for assistance. Specifically, I needed to choose the row based on the file name. Below is the rele ...

When attempting to transmit data to the server, an error message pops up in the DevTools console of the browser. The error is displayed as "Network Error at create

I am currently utilizing React JS for the front end of my web application and PHP for the back end. When I try to send data to the server upon clicking a button on the webpage, I encounter the following error: Network Error at createError (createError.js:1 ...

Getting an Array of all values in <th> using jQuery

Is there a more efficient way in jQuery to retrieve an array of all the inner texts of <th> elements within a table? The following code snippet successfully achieves this: $("th").toArray().map(th => th.innerText) I'm curious if there is a ...