How to make menu as static element?
I like to make menu as static option. How to set in the correct way?
<ul id="topmenu" style="top: 0px; position: static;">
Is this correct way inside css file or inside page style='' ''?
Can be improved?
Static is the default option, so yes, it can be improved by simply not including it!
Keep your styles in your external stylesheet, this is the correct way to format it
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;
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.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)