Results 1 to 4 of 4

Thread: How to make menu as static element?

  1. #1
    Join Date
    Sep 2005

    How to make menu as static element?

    I like to make menu as static option. How to set in the correct way?
    PHP Code:

    <ul id="topmenu" style="top: 0px; position: static;"
    PHP Code:
    element.style {
    position: static;

    Is this correct way inside css file or inside page style='' ''?
    Can be improved?

  2. #2
    Join Date
    Sep 2008
    Akron, OH
    Static is the default option, so yes, it can be improved by simply not including it!
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

  3. #3
    Join Date
    Aug 2012
    Keep your styles in your external stylesheet, this is the correct way to format it
    #topmenu { 
        position: static; 
        top: 0; 
    HTML Code:
    <ul id="topmenu">
    As position: static is the default positioning used for html elements then you don't need to specify it anyway and you also don't need the top: 0 unless you are positioning absolutely or relatively.

    If you want the menu to stay fixed when scrolling then you would use position: fixed; top: 0;

  4. #4
    Join Date
    May 2003
    The correct way to do it is with fixed positioning. using position: fixed; as listed in the previous reply. Just remember that fixed positioning does not work in all browsers, in particular, Internet Explorere 8 and earlier does not recognize fixed positioning and this browser is still the most popular browser worldwide.

    If you want your code to be cross browser compliant I would recommend researching a jquery option to fixed positioning.
    Jawaune Saad

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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