Advertisement
cdsatrian

simple menu

Aug 30th, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>test menu</title>
  4. </head>
  5. <body>
  6. <style type="text/css">
  7. body {
  8.   font-family:verdana;
  9.   font-size:10px;
  10.   color:#000;
  11. }
  12. div {
  13.   padding:0px;
  14. }
  15. a{
  16.   padding:3px;
  17.   margin:0px;
  18.   background-color:#99c;
  19.   text-decoration:none;
  20. }
  21. a:hover {
  22.   background-color:#ccc;
  23.   text-decoration:none;
  24. }
  25. .active {
  26.   background-color:#ffc;
  27. }
  28. </style>
  29. <div>
  30. <?php
  31. $menu=isset($_GET['m'])?$_GET['m']:'home';
  32. $menus=array('home','product','support','about');
  33. for($i=0;$i<count($menus);$i++){
  34.   echo "<a href=\"?m=".$menus[$i]."\"".($menu==$menus[$i]?" class=\"active\"":"").">".$menus[$i]."</a>\n";
  35. }
  36. ?>
  37. </div>
  38. </body>
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement