1. Overview
<" />
  1. Overview
<" />
  1. Overview
<"/>

TechQA.

How can I keep this navigation bar at the top when I scroll the page?

622 views Asked by Andrew Truckle At 2021-08-05T04:34:41+00:00 05 August 2021 at 04:34 2025-12-24T20:54:29+00:00

Link to page.

Code

<div class="navigation">
    <ol class="breadcrumb">
        <li><a href="msa-overview.html">Overview</a></li>
    </ol>
    <div class="nav-arrows">
        <div class="btn-group btn-group" role="group"><div class="btn-group"><button type="button" title="In this page..." class="btn btn-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></button><ul id="inline-toc" class="dropdown-menu dropdown-menu-right"><li><a href="#Quick_Start_Getting_Started">Quick Start - Getting Started</a></li><li><a href="#Step_1">Step 1</a></li><li><a href="#Step_2">Step 2</a></li><li><a href="#Step_3">Step 3</a></li><li><a href="#Step_4">Step 4</a></li></ul></div><a class="btn btn-default" href="msa-overview.html" title="Overview" role="button"><span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span></a><a class="btn btn-default" href="msa-overview.html" title="Overview" role="button"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span></a><a class="btn btn-default" href="msa.html" title="Using Meeting Schedule Assistant" role="button"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span></a></div>
    </div>
</div>

Screengrab

enter image description here

Background

This website is built with HelpNDoc. I wanty to update my HTML building template so that this navigation bar floats at the top when you scroll the page. At the moment the navigation bar goes away.

If I understood what structural changes are needed in the HTML content then I will be able to modify my HelpNDoc HTML build template.


Update

Based on the answer provided I did some testing within the browser itself by changing the navigation bar element:

position: fixed;
background-color: #fff;

It looks like this:

enter image description here

It does stick at the top which is good but I have two questions now:

  1. How do we get the navigation arrows etc. to stay over on the right? Like they did before?

  2. In the answer it states:

add some padding to the header at the top of the page so that the navigation element does not overlap the page content.

Where do we add this pading exactly? And what value should we use? Since this help documentation can be viewed on varied screen sizes etc.

javascript html helpndoc
Original Q&A
1

There are 1 answers

3
see sharper see sharper On 2021-08-05T04:43:39+00:00 05 August 2021 at 04:43 BEST ANSWER

You can apply position: fixed to the navigation div, add background-color: #fff, and then add some padding to the header at the top of the page so that the navigation element does not overlap the page content.

Related Questions in JAVASCRIPT

  • Using Puppeteer to scrape a public API only when the data changes
  • inline SVG text (js)
  • An array of images and a for loop display the buttons. How to assign each button to open its own block by name?
  • Storing the preferred font-size in localStorage
  • Simple movie API request not showing up in the console log
  • Authenticate Flask rest API
  • Deploying sveltekit app with gunjs on vercel throws cannot find module './lib/text-encoding'
  • How to request administrator rights?
  • mp4 embedded videos within github pages website not loading
  • Scrimba tutorial was working, suddenly stopped even trying the default
  • In Datatables, start value resets to 0, when column sorting
  • How do I link two models in mongoose?
  • parameter values only being sent to certain columns in google sheet?
  • Run main several times of wasm in browser
  • Variable inside a Variable, not updating

Related Questions in HTML

  • How to store a date/time in sqlite (or something similar to a date)
  • How to use custom font during html to pdf conversion?
  • Storing the preferred font-size in localStorage
  • mp4 embedded videos within github pages website not loading
  • Scrimba tutorial was working, suddenly stopped even trying the default
  • Is there any way to glow this bulb image like a real light bulb
  • With non-graphical maps in Leaflet, zoomDelta doesn't work
  • What can I do to improve my coding on both html and css
  • Uncaught TypeError: google.maps.LatLng is not a constructor at init (script.js:7:13)
  • Bootstrap modal not showing at the desired position on a web page when the screen size is smaller
  • Displaying a Movie List on a Website Using Jinja2 and Bootstrap
  • How to redirect to thank you page after submitting a Google form embedded into a Google Site?
  • Storing selected language in localStorage
  • Fences (parenthesis, braces) in HTML and MathML
  • Understanding Scroll Anchoring Behavoir

Related Questions in HELPNDOC

  • Javascript does not work fine in google chrome
  • How to define keywords in helpndoc using api in script editor
  • HelpNDoc : Problem to generate CHM format help - Error HHC5010
  • Images are too small on handheld devices and change proportions
  • Adding custom CSS content to CHM projects in HelpnDoc
  • Text is not rendered from base line of image. OK for CHM but not HTML
  • Renumbering topic Context ID values using HelpNDoc API
  • HelpNDoc online help not showing correct buttons and correct contents functionality
  • Linking to specific topics in HelpnDoc compiled CHM using Visual C++ HtmlHelp
  • Using XPath to locate a node in a XML file with a HelpNDoc custom template
  • Updating HelpNDoc script to locate library items in help topics
  • Why is my script not building in HelpNDoc? Error: Unknown name
  • How can I find / replace text in the Description field of a HelpNDoc file?
  • Use Id instead of Context
  • How can I keep this navigation bar at the top when I scroll the page?

Popular Questions

  • How do I undo the most recent local commits in Git?
  • How can I remove a specific item from an array in JavaScript?
  • How do I delete a Git branch locally and remotely?
  • Find all files containing a specific text (string) on Linux?
  • How do I revert a Git repository to a previous commit?
  • How do I create an HTML button that acts like a link?
  • How do I check out a remote Git branch?
  • How do I force "git pull" to overwrite local files?
  • How do I list all files of a directory?
  • How to check whether a string contains a substring in JavaScript?
  • How do I redirect to another webpage?
  • How can I iterate over rows in a Pandas DataFrame?
  • How do I convert a String to an int in Java?
  • Does Python have a string 'contains' substring method?
  • How do I check if a string contains a specific word?

Popular Tags

javascript python java c# php android html jquery c++ css ios sql mysql r reactjs node.js arrays c asp.net json

Trending Questions

  • UIImageView Frame Doesn't Reflect Constraints
  • Is it possible to use adb commands to click on a view by finding its ID?
  • How to create a new web character symbol recognizable by html/javascript?
  • Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
  • Heap Gives Page Fault
  • Connect ffmpeg to Visual Studio 2008
  • Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
  • How to avoid default initialization of objects in std::vector?
  • second argument of the command line arguments in a format other than char** argv or char* argv[]
  • How to improve efficiency of algorithm which generates next lexicographic permutation?
  • Navigating to the another actvity app getting crash in android
  • How to read the particular message format in android and store in sqlite database?
  • Resetting inventory status after order is cancelled
  • Efficiently compute powers of X in SSE/AVX
  • Insert into an external database using ajax and php : POST 500 (Internal Server Error)
  • Privacy
  • Terms
  • Cookies
  • Homegardensmart
  • Math
  • Aftereffectstemplates