Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm creating a navigation system and currently all I have is the titles at the top of the screen, side by side, e.g. home, about us and so on.

I'm unsure how I would create a fixed position for the navigation system at the top of the screen, so when you scroll down etc the options will still be there to click onto at the top of the screen.

Also, how it would be possible to add a background colour just to the navigation system?

Thank you.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
189 views
Welcome To Ask or Share your Answers For Others

1 Answer

Try something like this:

In between the tags in the HTML:

<div id='header'>NAVIGATION LINKS</div> 

and in the CSS put:

#header{
   padding:10px;
   height:20px;
   position:fixed;
   width:100%;
}

Here's a JSFiddle: http://jsfiddle.net/MGumH/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...