473,395 Members | 1,452 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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. }
  14.  
  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. }
  24.  
  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. }
  31.  
  32. #nav a:hover {
  33. background-position: 0 -28px;
  34. }
  35.  
  36. #nav a:active, #nav a.selected {
  37. background-position: 0 -56px;
  38. }
  39.  
  40. #hjem a  {
  41. width: 58px;
  42. background: url(Html/Img/site/menu/hjem.gif) top left no-repeat;
  43. }
  44.  
  45. #hjelp a  {
  46. width: 107px;
  47. background: url(Html/Img/site/menu/hjelp.gif) top left no-repeat;
  48. }
  49.  
  50. #brukerveil a  {
  51. width: 140px;
  52. background: url(Html/Img/site/menu/brukerveil.gif) top left no-repeat;
  53. }
  54.  
  55. #e-learn a  {
  56. width: 126px;
  57. background: url(Html/Img/site/menu/e-learn.gif) top left no-repeat;
  58. }
  59.  
  60. #forum a  {
  61. width: 65px;
  62. background: url(Html/Img/site/menu/forum.gif) top left no-repeat;
  63. }
  64.  
  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. }
  71.  
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>
  8.  
  9. </div>
  10.  
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 5338
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
acoder
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
jhardman
3,406 Expert 2GB
Kenny,

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.

Jared
Dec 17 '07 #4

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

Similar topics

13
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...
2
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...
7
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...
0
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...
1
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...
2
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...
1
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...
19
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.