Ensure that the search button remains at the bottom of the view without overlapping its container

this codepen link will take you to the relevant content

https://codepen.io/rad-mej/pen/qBKedwB

I have a fixed search menu on the left, along with data displayed on the right. The search menu contains a search button that I want to be anchored to the bottom of the view. As the user scrolls down, I'd like it to stick at the end of the menu section and continue displaying. Is this feasible?

Here is some CSS code for reference:

.main-container {
  display: flex;
  gap: 1rem;
}

.filter-menu {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 600px;
  position: relative;
  border: 1px solid DarkKhaki;
}

.search-button {
  position: fixed;
  bottom: 1px;
}
<div>menu and other content></div>
<div> some other content</div>
</br>
...
(continued)
<div>

Answer №1

To achieve this effect, use the CSS properties positin: sticky and bottom:20px; However, ensure that none of the parent elements of the search button have an overflow attribute.

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

Disabling vertical scrollbar in textarea within Bootstrap modal using CSS, jQuery, and C# in .NET MVC framework

I am passing data to the Bootstrap modal using jQuery from my database. The form values can change from a single row to multiple rows. I do not want a scrollbar, but instead I want the textarea element to automatically adjust its height to fit the content. ...

Enhancing images with dual captions using CSS hover effects

I have been experimenting with creating an image that, upon hover, displays a caption sliding out from left to right on the top and bottom. I have managed to achieve this effect on two separate images - one displaying the top caption and the other displayi ...

The CSS infinite animation becomes erratic and sluggish after a short period of time

My website featured a banner with a series of thumbnail images that animated at different intervals and looped indefinitely. Initially, the animations ran smoothly, but after a few seconds, they began to slow down and lose consistency. To troubleshoot, I u ...

What is the best way to incrementally add elements and automatically update them in the browser using JavaScript?

Below is a function that triggers when a button is clicked, adding 30 div elements to the document with specific attributes. var bar_counter = 0; bar_lengths = new Array(); function createBar(btnObj) { while(bar_lengths.length < 30){ var siz ...

Two-toned diagonal design featuring a lone character

I'm searching for a unique design featuring the letter "d" in two colors, arranged diagonally without any gradient effects. Here is the CSS code I am currently using: .gradient_text_class { font-size: 72px; background-image: linear-gradient(50de ...

validating forms with an abundance of checkboxes

Currently, I am in the process of creating a checkbox form that consists of more than 200 questions (yes, I know, quite ambitious!). My main requirement is to prevent the user from advancing to the results page unless they have checked at least one checkbo ...

Is it possible to modify the colors of a box and text when hovering over it?

I am currently working on a styled subscribe button and have encountered an issue. I want the background color of the entire box to change, along with the text color, when hovering anywhere on the box. However, my current code only changes the text color w ...

Layer one image on top of another image

I've been working on a website and I'm trying to overlay one image on top of another. Let me explain. Inside a td element with a width: 1101px, I have placed an image using the img tag (the logo of my website). The width of this image is 1101px. ...

What is the best way to implement horizontal scrolling in a div with the "inertia" style?

I recently added horizontal scrolling to my website wikiprop.org, following a tutorial from another website. However, I noticed that my scroll does not have the same inertia/momentum effect where it continues scrolling after a swipe and gradually slows dow ...

With the ngx-print tool, the printing background is consistently set to white

Currently, I am utilizing the ngx-print npm library for printing my div. It functions properly but the issue lies in it not displaying the background color accurately: https://i.sstatic.net/Yq0aZ.jpg This is My HTML Code : <div class="hover-div&q ...

CSS Problem - Struggling to display <div> element in inline format

Here is the HTML code I am struggling with: @using (Html.BeginForm("Create", "BicycleSellerListing", FormMethod.Post, new { enctype = "multipart/form-data" })) { @Html.ValidationSummary(true) <fieldset style="margin:5px;"> <legen ...

Experiencing a scroll problem in the latest version of Google Chrome for Android while using ReactJS? The issue seems to have migrated from the earlier version 99.xxxxxx to

Previously, my website was functioning perfectly in full screen mode. However, after updating Chrome on Android to the latest version (116.xxxxxx....), I noticed that it is now displaying a scrolling behavior that was not present in the earlier version (99 ...

Problem with CSS dotted borders appearing as dashed in Chrome when applied to adjacent columns in a table

After testing the code on both Chrome and Firefox browsers, I noticed that they display the border differently. In Chrome, there is a dash in between adjacent cells while in Firefox, there are no dashes rendering. Can anyone suggest a solution to fix thi ...

How can I apply a unique CSS class to specific rows within an h:dataTable?

I am looking to apply unique CSS classes to certain rows within my <h:dataTable>. Is it possible to manipulate and style the individual table rows in a customized manner? ...

I want to create a form with two dropdown menus placed side by side within a parent DIV, and I want them to collectively occupy the entire width using Bootstrap

Currently, I am working on a search form using Bootstrap. Everything is going well, but I am facing an issue where two multi-option elements need to be placed side by side and together occupy 100% of the width within their containing DIV. Just for clarity ...

Windows and MacOS each use unique methods for displaying linear gradients

Check out this code snippet featuring a background gradient background: rgba(0,0,0,0) linear-gradient(rgb(245, 245, 245),rgba(0,0,0,0)) repeat scroll 0 0; This code renders correctly on Windows (chrome, ie, firefox) https://i.stack.imgur.com/XU2gW ...

How can I delete a video on mobile in WordPress?

Looking for some assistance with my webshop www.spidercatcher.dk. I'm trying to have a background video display only on PCs, while showing a still photo on phones and tablets. I've tried using a poster tag but I can't seem to scale it proper ...

The secondary menu appears prominently above the primary menu

Here is my .html code : {% load i18n %} <div class="customer-context-menu closed {% if customer.gender == 0 %}male{% else %}female{% endif %}"> <b class="unselectable"> {{ customer.icon }} {{ user.get_full_name }} < ...

Enhancing the appearance of the bootstrap fixed navbar with additional elements above and below

I am attempting to include a banner above my fixed-top navbar. Although I have some basic understanding of how to achieve this, my specific example seems to be more complex and I am struggling to find the right solution. Users should be able to add a cust ...

Using Inline Styling to Showcase a Background Image in a REACTJS Component

import React from 'react'; import Slick from 'react-slick'; import style from './Slider.module.css'; import {Link} from 'react-router-dom'; const SliderTemplates = (props) => { let template = null; const ...