How to create a fixed top panel?

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

I'm not sure how one could constantly be visible on the screen and would I need to create CSS to create a navigation bar or insert a black box and then CSS up?

+4
source share
2 answers

CSS

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

http://jsfiddle.net/LzDR7/

+16
source

In the div, which is this black bar, set the "position" property to "fixed" in css as follows:

 position: fixed; 
+1
source

Source: https://habr.com/ru/post/1479418/


All Articles