Creating a div that reaches the bottom of a scrollable webpage in ASP

Struggling to position my sidebar at the bottom of the page without using fixed positioning, as I don't want the buttons to scroll along with it. I simply want the background to extend to the bottom of the scrollable page. Despite trying various "solutions," I've only managed to get the background to either extend to the visible page or wrap around the buttons. Additionally, setting a fixed height like 'height: 3000px' won't work due to different screen resolutions.

This issue is within a Master Page.

Current layout can be seen here: http://prntscr.com/7dpa8j

ASP code in masterpage:

<body>

<form id="form1" runat="server">
    <asp:ScriptManager ID="mainSM" runat="server" />

        <div id="header">
            <asp:ContentPlaceHolder ID="ContentHolderDD" runat="server">

            </asp:ContentPlaceHolder>
            <div>
                <p id="teamNames" class="regularTextWhite">Tom, Rutger & Mike</p>
            </div>

            <img id="logo" src="../../Images/top2000.gif" />
            <div>
                <p id="welcomeMessage" class="regularTextWhite" runat="server">Welkom FIRST_NAME</p>
            </div>
            <asp:Button ID="btnLogout" text="Uitloggen" runat="server" CssClass="btnRed"  Visible="false" OnClick="btnLogout_Click"/>
            <asp:Button ID="btnLogin" text="Inloggen" runat="server" CssClass="btnRed" OnClick="btnLogin_Click" />     
        </div>
        <div id="sidebar">
            <div id="sideMenu" runat="server">
                <asp:Button ID="btnList" text="Lijst" runat="server" CssClass="btnClean" PostBackUrl="~/Pages/Pages/List.aspx"/>
                <asp:Button ID="btnArtists" text="Artiesten" runat="server" CssClass="btnClean" PostBackUrl="~/Pages/Pages/Artists.aspx"/>
                <asp:Button ID="btnSongs" text="Lietjes" runat="server" CssClass="btnClean" PostBackUrl="~/Pages/Pages/Song.aspx"/>
            </div>
        </div>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
        </asp:ContentPlaceHolder>
</form>
</body>

CSS:

#sidebar {
background-color: white;
border-right: 1px solid rgb(100, 100, 100);
width: 250px;
height: 1000px;
float: left;
overflow-y: auto;
position: relative;
}

#sidemenu {
height: 100%;
}

Answer №1

DEFINE height : 100vh;

#sidebar {
background-color: white;
border-right: 1px solid rgb(100, 100, 100);
width: 250px;
height:100vh;
float:left;
overflow-y:auto;
position:relative;

}

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

Initiate movement upon scrolling

I would like to activate this box animation once the user scrolls down by adding a class. I'm having trouble getting this to work, it seems like I might be missing something crucial. Here is my current code, can someone point out where I am going wro ...

Styling the select dropdown border in Google Chrome

I am encountering an issue with styling HTML select options in Chrome. Despite successfully applying borders to each option in Firefox, I cannot get it to work in Chrome. Can anyone advise on how this can be achieved? <select id="sortingOptions" class= ...

Obtain the numerical value of the vertical position of the mouse (

Currently, I am coding a JavaScript game and my objective is to designate a variable specifically for the Y axis of the mouse. I kindly request that the code be kept as simple and straightforward as possible, avoiding unnecessary complexity. That conclud ...

Creating a clear division between the jumbotron and column divs using whitespace in Bootstrap design

Having some issues with my Bootstrap layout. I have a jumbotron div at the top, which looks fine, but the columns and rows underneath are not aligning properly and seem to be wider than they should be. I suspect it might have something to do with the grid ...

Applying a class in jQuery to an element when the data attribute aligns with the current slide in Slick

I need to compare the data-group attribute of the current slide to the equivalent attribute in a navigation list. If they match, the anchor element in the navigation list should be given an active class. How can I achieve this using jQuery? Navigation Li ...

Specialized function to identify modifications in data attribute value

I have a container with a form inside, featuring a custom data attribute named data-av Here is how I am adding the container dynamically: > $("#desti_div").append("<div class='tmar"+count+"'><div > class='form-group col-md-6 ...

Sass/SCSS is failing to compile on my local environment

As a beginner in SASS, I'm currently attempting to compile my SASS file on my local machine. Unfortunately, I've hit a roadblock and despite trying all the methods mentioned, I continue to encounter the same or similar errors. It's frustrati ...

What is the best way to trigger two separate JavaScript/jQuery functions on a single HTML control, specifically a text field, in response to

Here is the HTML code I have for a text field where functions are implemented: <input type="text" class="form-control" size="20" onblur="GetLocation();" id="zip_code" name="zip_code" value=""> <input type="text" class="form-control" size="20" r ...

Having trouble with Select2 functionality within a modal in Bootstrap version 4.6.0?

I've recently started working with bootstrap 4 and I'm already on the lookout for alternatives to solve this issue. Both select2 elements are functioning normally but when I place them inside @include() in the modal tab-content, they behave diffe ...

Issues with Read More/Less functionality on a website - Troubleshooting with JavaScript, jQuery, and Bootstrap 4

I'm looking to create a simple, lightweight feature where clicking on a "read more" link will reveal a paragraph, and then clicking on a "read less" link will hide it again. My knowledge of JS and JQuery is quite limited. I'm currently utilizing ...

Building a dynamic tab menu using JavaScript: A step-by-step guide

In order to generate dynamic tab menus with JavaScript, I am seeking a solution that does not rely on jQuery as it may not be supported by all mobile devices. Any advice for replicating the same functionality using pure JavaScript would be greatly apprec ...

JavaScript document string separation

Hi there, I'm a newbie here and could really use some assistance. I am struggling with creating a function and would appreciate any ideas... To give you an idea of what I need help with, I have a String and I want to check if it contains a specific w ...

Guide on incorporating descriptive text for an image by utilizing a data attribute within its parent element

I'm trying to find a way to attach an alt-text attribute to an image by assigning a data attribute to its parent container. Essentially, any text I input in the data-alt attribute will be set as the alt-text for the img element. How should I format ...

Having difficulty generating a suitable CSS selector

Within a webpage, there are two types of links. One type includes both a class and itemprop, while the other type only contains a class. In the examples below, the first link has both class and itemprop, and the second link only has a class. If I want to c ...

What is the best way to choose all cells that begin, include, or finish with a specific term using JQuery/CSS?

I have a table with some cells and I am looking to utilize JQuery to select specific cells. For example: <td>John Doe</td> <td>John Doe1</td> <td>1John Doe</td> I want to select cells that start with 1, include Doe, a ...

Interactive Features in Vue Component

In my Vue Component, I have a prop named src that is bound to a :style attribute like this: <template> <section :class="color" class="hero" :style="{ backgroundImage: src && 'url(' + src + ')' }"> <slot> ...

Position the div in the center with overflow properties

After returning to web design as a hobby, I've encountered some difficulties. I'm currently trying to center a div that contains other centered divs. However, when resizing the page, I want to ensure that the divs remain centered and their overfl ...

Data loading issue with asp.net mvc Ajax

I am currently facing an issue while attempting to fetch data from the controller using ajax. Controller [HttpGet] public ActionResult GetServices() { var data = _bbdb.ListServices.Where(d => d.Status == true).ToList(); return Json(data, JsonR ...

Creating a table with a mix of fixed and variable width columns

Is it possible to design a table using CSS that has the first three columns with a fixed width in pixels and the rest with a width in percentage like the example shown here: I am familiar with creating columns with variable or fixed widths, but unsure how ...

Dispose of jQuery instance when it is no longer required

Encountered an issue with jQuery: There are multiple div containers on a page with the class "stackgo" and different data attributes. For example: <div class=\"stackgo\" data-an=\"HEY\" data-ms=\"HO\" data-me=\"HM&bso ...