View Full Version : Google, MENU BAR?

02-25-2009, 05:32 AM
Hi there, I am trying to design a website with the menu bar staying static at the top like in googles homepage... google.com look at the top and you see sign in and all that stuff at the top, well i would like to replicate such a design and would like to use it at the top of every page I create, how can I go about doing this? a similiar example is shown at this website at the top too hmv.com

02-25-2009, 10:22 AM
Hello est1984
You can use position:fixed; to make that menu stay at the top of the browser window and your content can scroll under it. Is that what your looking for? Have a look at this demo - http://nopeople.com/CSS/position%20fixed/
Look at the source to see how it's done.

02-26-2009, 06:58 AM
Is it just the navbar that you are looking for? If so, try this:


<style type="text/css">
body {margin: 0px; border: 0px;}

#navcontainer {width: 100%; height: 20px; margin-top: 0px; border-bottom: 1px solid #a7bfe1;}

#topnav1 {float: left; clear: right; margin-left: 10px; width: 45%; height: 20px; text-align: left; border: 1px solid#45a638;}

#topnav2 {float: right; width: 45%; margin-right: 10px; height: 20px; text-align: right; border: 1px solid#45a638;}

#centrepane {width: 600px; height: 500px; margin-left: auto; margin-right: auto; margin-top: 0px; border: 1px solid #FF0000;}

<div id="navcontainer">

<div id="topnav1"> here come some links</div>
<div id="topnav2">here come some more links</div>

<div id="centrepane">
centre content

I have put borders around each of the divs so that you can see which one each corresponds to.


04-04-2009, 04:16 AM
I appreciate yourhelp with this, I know its been a long time, but I felt I should only comment until I actually got it up where its useful.

So far this is as far as I have come... http://d32i.com/forumsv2/index.php the only problem I'm having is that the links are all in blue, and the font kinda looks distorted.

I used this code but then it ruined my whole board all together

a:link {color: #000000; text-decoration: underline; }
a:active {color: #0000ff; text-decoration: underline; }
a:visited {color: #008000; text-decoration: underline; }
a:hover {color: #ff0000; text-decoration: none; }

any ideas?