Question

 <ul id="verticalmenu">
   <li><a href="http://www.yourlink.com/">Home</a></li>
   <li><a href="http://www.yourlink.com/">Vertical Menu</a></li> 
   <li><a href="http://www.yourlink.com/">Drop Down Menu</a></li>
   <li><a href="http://www.yourlink.com/">Fading Banner</a></li>
   <li><a href="http://www.yourlink.com/">Web Design Blog</a></li>  
</ul>

If this is my menu.php, how can I call it on other pages? I want it to be static or say fixed. It should be present in every page, I navigate to.

http://oi57.tinypic.com/2j0nq5i.jpg

How can I do so, just like the red block in the img??

Was it helpful?

Solution

I would suggest making a header.php file that contains the full header of your site, including the menu. Once you have done that, you can just call include("header.php"); on every page and your entire header will be brought in. This will also allow you to make one change in one file and affect the entire site.

To position the menu on the left or right, you are going to want to wrap the menu with a css call similar to float: left; or float: right; jsfiddlee: http://jsfiddle.net/jjS98/

here is the css code for floating your menu to the right:

#verticalmenu{
    float:right;
}

You can change right to left for the desired results.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top