472,357 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,357 software developers and data experts.

Horizontal ASP menu based on CSS mouse states?

Hi! I'm currently working on a menu which is based on CSS and is listed with <li> tags. The CSS code looks like this:

Expand|Select|Wrap|Line Numbers
  1. #nav {
  2. position: absolute;
  3. top: 101px;
  4. left: 390px;
  5. list-style: none;
  6. margin: 0;
  7. padding: 0;
  8. height: 28px;
  9. display: inline;
  10. overflow: hidden;
  11. width: 603px;
  12. background: url(Html/Img/site/menu/navbar.gif)
  13. }
  15. #nav li {
  16. position:relative;
  17. float:left;
  18. margin: 0; 
  19. padding: 0;
  20. display: inline;
  21. overflow: hidden;
  22. list-style-type: none;
  23. }
  25. #nav a {
  26. float: left;
  27. padding: 28px 0 0 0;
  28. overflow: hidden;
  29. height: 0px !important; height /**/:20px; /* for IE5/Win */
  30. }
  32. #nav a:hover {
  33. background-position: 0 -28px;
  34. }
  36. #nav a:active, #nav a.selected {
  37. background-position: 0 -56px;
  38. }
  40. #hjem a  {
  41. width: 58px;
  42. background: url(Html/Img/site/menu/hjem.gif) top left no-repeat;
  43. }
  45. #hjelp a  {
  46. width: 107px;
  47. background: url(Html/Img/site/menu/hjelp.gif) top left no-repeat;
  48. }
  50. #brukerveil a  {
  51. width: 140px;
  52. background: url(Html/Img/site/menu/brukerveil.gif) top left no-repeat;
  53. }
  55. #e-learn a  {
  56. width: 126px;
  57. background: url(Html/Img/site/menu/e-learn.gif) top left no-repeat;
  58. }
  60. #forum a  {
  61. width: 65px;
  62. background: url(Html/Img/site/menu/forum.gif) top left no-repeat;
  63. }
  65. #kontakt a  {
  66. width: 96px;
  67. background: url(Html/Img/site/menu/kontakt.gif) top left no-repeat;}    
  68. .leftmenu_wrap {
  69. float: left;
  70. }
And the HTML code looks like this:

Expand|Select|Wrap|Line Numbers
  1. <ul id="nav">
  2. <li id="hjem"><a href="#"></a></li>
  3.     <li id="hjelp"><a href="#"></a></li>
  4.     <li id="brukerveil"><a href="#"></a></li>
  5.     <li id="e-learn"><a href="#"></a></li>
  6.     <li id="forum"><a href="#"></a></li>
  7.   <li id="kontakt"><a href="#"></a>        </li></ul>
  9. </div>
Pretty basic so far right? So, I was browsing the net and came across this ASP script: http://www.asp101.com/articles/prabh...ar/default.asp

And now I'm trying to merge these together the best way I can, but I don't understand anything.. The ASP menu in the link posted above is based on tables and not css! So how can I do the same thing only with my own menu?
Would someone care to explain or perhaps copy and paste a little to perhaps create a working example? Shouldn't be that hard should it? I just can't wrap my head around the html table codes in the ASP-files cause each entry in the menu has it's own asp-file and the menu gets sorta compiled from each of these files and with another file where the rest of the menu lies (include/common.asp).
Dec 13 '07 #1
3 5282
bumpybumpbump bumpitybump. Really need some help on this. Isn't it possible to use css code in the asp tags? Is there something I can put in the original code to better understand what is what and how the menu gets created dynamically?
Dec 14 '07 #2
16,027 Expert Mod 8TB
I don't know the exact ASP syntax, but you could check the current page. Let's say it's hjem.asp. If it is, then set the 'hjem' LI element to an 'active' class. In your CSS, you will need to set the properties of this active class:
Expand|Select|Wrap|Line Numbers
  1. .active { ... }
I think that should be enough to solve your problem. Hopefully, one of the ASP experts can help you with the ASP syntax.
Dec 14 '07 #3
3,406 Expert 2GB

Your css-based code is actually better, the table based menu you linked to is terrible. The great thing the ASP code did was put all of the menu in a separate file which can be included in every page in your site. You can do this with your menu, just put the entire menu in a separate file, and include that in every file you want to have the menu. The code you linked to used some function call to highlight which page you were already on to make it obvious that that link in the menu is different from the rest, that is the only useful part of that code. Let me know if this helps.

Dec 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

by: elad | last post by:
Hi The Menu doesn't work properly when I have 2 frame and the Menu popup frame=document target frame, when I choose item in the menu the doc opened and the menu get stuck. Here is the code...
by: Ansgar Hein | last post by:
I have been playing around with several different versions for a horizontal menu, but I haven't been able to build a horizontal navigation based on the vertical one featured on www.alistapart.com...
by: addled | last post by:
Hi there, after reading posts here for a few months, I've built the courage to see if someone can see where I"m going wrong in the webpage I've been working on. In particular the horizontal nav...
by: Just D. | last post by:
I'm using the frame set as a combination of aspx and html pages. It works great but the I can't disable the horizontal scrolling. First time I found that I can make the main menu invisible sliding...
by: Stephen | last post by:
Hi From an example supplied with Visual Web Developer Express 2005, I am trying to build a "horizontal menu" with drop down links. In the example below I have added: url="mouse.aspx?/"> to...
by: Sergio E. | last post by:
Hi group, I write this post with the following question: How can I to build an absolutely horizontal menu?, This is because I can't find how can I configure the menu component of asp.net 2.0...
by: camphor | last post by:
hi, I have a single column webpage with a horizontal dropdown menu and am trying to make the nav bar fit across the page, the column is 800px, it looks ok in dreamweaver 8 but when I test it in...
by: Jim | last post by:
Hi, I have two questions/problems pertaining to CSS horizontal dropdown menus and am hoping that someone here can help me out. (1) I'm having a problem centering the menu. I picked up the...
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.