Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Put a bar at the bottom of a page

Tags:

css

I need to put a fixed bar for showing a news title at the bottom of a page regardless of the page's height and device display height.

How can I do that using CSS?

like image 326
hd. Avatar asked Nov 13 '10 07:11

hd.


People also ask

How do you place a navbar at the bottom of the page?

To set the navigation bar at bottom, use position: fixed property, with bottom property.

How do I add a footer to the bottom?

The trick is to use a display:table for the whole document and display:table-row with height:0 for the footer. Since the footer is the only body child that has a display as table-row , it is rendered at the bottom of the page.

How do you reach the bottom of a page?

No, by far the best way to jump to the top or bottom of a Web page is by tapping your Home or End key, respectively. This works in Chrome, Firefox, and Internet Explorer (and probably every other browser as well–those are just the ones I've tested).


1 Answers

Set this bar's position property to fixed, and its bottom and left coordinates to 0. Set a high z-index so that it appears over top of whatever other content is at the bottom of the page at a given time. It will then stay stuck to the bottom of the browser window.

#someidentifier {
    position: fixed;
    z-index: 100; 
    bottom: 0; 
    left: 0;
    width: 100%;
}
like image 107
Dan Grossman Avatar answered Oct 18 '22 19:10

Dan Grossman