limit footer scrolling restrictions

My Html page has a menu bar created in the footer area. Currently, the entire page is scrollable. How can I prevent scrolling only for the footer and restrict it to the content of the page?

The code for the footer menu bar is shown below:

#menu-bar {
    height: 50px;
    position: fixed;
    left: 0px;
    bottom: 0px;
    width: 100%;
    margin: 0px;
    padding: 0px;
    line-height: 10px;
    background: #F07C1F;
    z-index: 1000;
}

Answer №1

Elements with specific positioning is exactly what you need...

http://jsfiddle.net/2ekwL/4/

#menu-bar {
    height: 50px;
    position: absolute;
    left: 0px;
    bottom: 0px;
    width: 100%;
    margin: 0px;
    padding: 0px;
    line-height: 10px;
    background: #F07C1F;
    z-index: 1000;
}
#body {
    position: absolute;
    top:0px;
    bottom:50px;    
    left: 0px;   
    overflow:auto;
}
p
{
    margin: 10px;
}

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

Guide to creating the onclick feature for a dynamic button in Meteor

<template name="actionTemplate"> {{#each action}} <button class="myButton" id={{_id}}>btn</button> {{> action}} {{/each}} </template> <template name="action"> <div class="sct" id={{_id}}> ...

There seems to be an issue with the HTML link not redirecting properly, as it is directing to www.oldpage.com/http://www

Has anyone experienced a similar issue before? I can't figure out why this is happening. Here's the HTML code I'm using: <a href="www.google.com">www.google.com</a> Despite it appearing correct, when I click on the li ...

What causes the `d-none` class to toggle on and off repeatedly when the distance between two div elements is less than 10 during window resizing?

My primary objective is to display or hide the icon based on the width of the right container and the rightButtonGroupWrapper. If the difference between these widths falls below 10, the icons should be shown, otherwise hidden. However, I'm facing an i ...

The function "getElementsByClassName" in Javascript is malfunctioning

I have redesigned my website by implementing an interactive feature where users can click on a tree image to remove it and replace it with a number using JavaScript. Initially, I targeted the specific tree with the following code: document.getElementById( ...

Adding spacing breakpoints in Material-UI 5 sx properties

Currently in the process of updating my components to utilize the latest MUI version. I have been converting old classes into the sx props and I find this new styling method to be more readable in my opinion. However, one thing that concerns me is handl ...

Is it possible to send a message from a child iframe to its parent using HTML5 cross-browser compatibility

I've been following this tutorial on a video-sharing website, which demonstrates how to securely pass messages between an iframe and its parent. The tutorial can be found at a specific URL. To achieve this functionality, you would end up with a simila ...

Hiding labels in an HTML document can be achieved by using CSS

Recently, I've been working on a code that relies on a specific Javascript from Dynamic Drive. This particular script is a form dependency manager which functions by showing or hiding elements based on user selections from the forms displayed. Oddly ...

Presenting titles and buttons within a Bootstrap modal window

I have implemented a modal using vue-bootstrap. The code for the modal is as follows: <template id="child"> <b-modal v-model="showModal" size="lg"> <template v-slot:modal-header> <h4 class="modal-title"> ...

Struggling with aligning two divs side by side on an HTML page

Recently, I've been experimenting with Electron and attempting to create 2 divs side by side. Despite trying various alignment options found here, nothing seems to be working for me. Here's the code I have so far: Code body, html { hei ...

What strategies can we implement to reduce the gutter width in Bootstrap 3?

Is there a way to decrease the gutter-width in Bootstrap 3? Since Bootstrap uses a 12-grids system, using col-sm-* creates a gap between elements of around 30px (15px on each side of the grid-column). However, my theme requires less space between columns ...

How come I can click on both radio buttons simultaneously?

How come I can select both radio buttons simultaneously? <form #form="ngForm"> {{ poll.counter1 }} votes <input type="radio" id="{{ poll.choice1 }}" value="{{ poll.choice1 }}" (click)="onChoice1(form)">{{ poll.choice1 }} <br> ...

In-Place Editing Revolutionizing Content Editing

What is the most effective method for editing content while using ng-repeat? In an ideal scenario, the added birthday would be displayed as a hyperlink. When clicked, it would reveal an edit form similar to the add form, along with an update button. Chec ...

How can I ensure my webpage displays properly on different devices using HTML?

I have been trying to make my code responsive by adding media queries, but I am struggling to get it to work with the current setup. I even attempted setting the width to 100%, but still facing issues. I would really appreciate a simple explanation on how ...

"Enhance Your Video Experience with a Custom

Currently, I am working on designing a front-page that features a YouTube video as the background with a fixed transparent navigation. Although I have successfully implemented both elements, I am struggling to make sure the video background starts at the t ...

What is the best way to launch a Popup window that spans from the top to the bottom of the screen?

I'm attempting to create a popup window that stretches from the top of the screen to the "applications" bar in Windows. Here's the code I'm using: function windowOpener(windowHeight, windowWidth, windowName, windowUri) { var windowHeight = ...

I can't seem to figure out why this isn't functioning properly

Upon examining the script, you'll notice the interval() function at the very bottom. The issue arises from bc-(AEfficiency*100)/5; monz+((AEfficiency*100)/5)((AFluencyAProduct)/100); For some reason, "bc" and "monz" remain unchanged. Why is that so? T ...

Show data based on the chosen destination

Recently, I've been working on creating a simple printer manager to monitor the status of all my printers. Although I have successfully displayed all the data, I'm facing an issue while trying to organize it by location. The error message I keep ...

What is the best way to alter the text color based on certain conditions within a table column using PHP

I am faced with multiple conditions involving if-else statements, where the variable "Remark" changes based on these conditions. if($income==($paid + $deduction)){ $remark="Paid"; } else if($paid > 0){ $remark="Have Due"; } else{ $remark="N ...

Which is better: using multiple makeStyles or just one in Material UI?

Uncertain about the best approach in this situation. Is it acceptable to generate styles using makeStyles for each component individually, or would it be better to create one in the base component and simply pass down class names? ...

Detecting a click event within a hidden div located behind another visible div

I am facing an issue with triggering ng-click in a div that is covered by another div. The current scenario I have is as follows: https://i.sstatic.net/SfM5y.jpg Basically, I need to activate ng-click on the yellow circle when it is clicked. However, the ...