Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Feb 2009
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Google, MENU BAR?

    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

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,744
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    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.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    Regular Coder
    Join Date
    Nov 2005
    Posts
    329
    Thanks
    3
    Thanked 19 Times in 19 Posts
    Is it just the navbar that you are looking for? If so, try this:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">
    <html>
    
    	<head>
    		<title>Sample</title>
    		<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;}
    		
    		</style>
    	</head>
    	<body>
    <div id="navcontainer">
    
    <div id="topnav1"> here come some links</div>
    <div id="topnav2">here come some more links</div>
    
    </div>
    <div id="centrepane">
    centre content
    </div>
    	</body>
    </html>
    I have put borders around each of the divs so that you can see which one each corresponds to.

    Cheers!

  • #4
    New Coder
    Join Date
    Feb 2009
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

    Code:
    <!--
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •