Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create a fixed top bar? [closed]

Tags:

html

css

I would like to create a black strip on the top of the page (used as the navigation system) and I want the position to be fixed, so when I scroll down on the page it will remain on the screen.

I'm unsure how it would be possible to allow it to be visible on the screen at all times & would I need to create a CSS to create the navigation strip, or insert a black box then CSS it to the top?

like image 925
Dane Avatar asked Dec 02 '22 23:12

Dane


1 Answers

CSS

#blackBar{
   position:fixed;
   top:0;
   left:0;
   width:100%;
   height:60px;
   background-color:black;
}

http://jsfiddle.net/LzDR7/

like image 178
npage Avatar answered Dec 05 '22 12:12

npage