473,856 Members | 1,690 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Horizontal ASP menu based on CSS mouse states?

4 New Member
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 5366
kenny bones
4 New Member
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 Recognized Expert Moderator MVP
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 Recognized Expert Specialist

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 I'm using: FrameSet ------------------------------------------------------- <html>
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 in the article "taming lists". However I have managed to build a horizontal navigation but it has a slight hitch in Mozilla and Opera, but it's fine in Internet Explorer. It is a strange occurrance of a 4 - 5 Pixel bar in grey (which is the...
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 bar accross the top of the page. viewd here http://foundations.port5.com/currprojects/babylon.html I am running win XP and have tested in both Avant (MSIE) and Opera 7.23 the result is a different problem in each.
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 it off the current frame, it was interesting and I tried to block that. Doesn't help. I still can scroll in a horizontal direction any aspx frame and that's not funny. How can I disable it? It's not easy to get such effect using usual mouse...
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 <siteMapNode title="Mouse" This works - i.e. If I click Products/Hardware/Mouse - mouse.aspx opens.
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 in vs2005. I need somthing like this: the root menu in this form
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 firefox, the nav bar which is a horizontal blue stripe with the links written inside it doesn't stretch the whole 800px, also how would you align the words in the submenu to the main menu, currently the submenus are centered html <body> <div...
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 code for this from a tutorial but that menu was flush-left justified. Not what I want. Subsequent searches on google on how to center yielded a
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.