473,566 Members | 2,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Scaling horizontal menu items

20 New Member
I would like to provide a scalable horizontal menu. Here's the twist: I want to keep the menu items on a single line for as many 'upscales' as possible. So I basically need 2 solutions:

1) For large-scale viewing, each <li><a> menu item should ideally be "shrinkwrapped" . A marginally acceptable alternative would be an em-based standard width that applies to all menu items.

2) For normal viewing, all <li><a> menu items should be a standard width that totals the full width of the page. For example, if there are 5 menu items, they should each take up 20% of the available space. This should also apply to each increase in font size up to the point where the words would not fit on a single line (even if shrink-wrapped).

Is the question clear? If so, is this possible?

Having done some searches on this forum, via google & W3C, I'm afraid I still couldn't find the answer.

Here's the stripped-down html:

Expand|Select|Wrap|Line Numbers
  1. <div id="primarynav">
  2.     <ul>
  3.         <li><a href="index.html">Home</a></li>
  4.         <li><a href="firstpage.html">First Page</a></li>
  5.         <li><a href="secondpage.html">Second Page</a></li>
  6.         <li><a href="thirdpage.html">Third Page</a></li>
  7.     </ul>
  8. </div>
  9.  
And some CSS:
Expand|Select|Wrap|Line Numbers
  1. #primarynav ul li { display: inline; }
  2. #primarynav ul li a { font-size: 1em; width: 5em; float: left; }
  3. /* afraid I can't remember why exactly the float is needed as well as the inline, but I took the float out & it doesn't work...I'm sure it made sense at the time... */
  4.  
Feb 5 '07 #1
0 1519

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

Similar topics

13
4988
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>
0
4387
by: itzikkl | last post by:
hello i wanted to ask about the menu control in asp.net 2.0. there is a property "Orientation" in the menu cotrol which specifies the Orientation of the main-uppper-level menu items. than the sub menus are been displayes as pop menu - vertically. is there a way to display the sub menu items, those which been in open in a vertical manner,...
5
3929
by: McGeeky | last post by:
I am looking for a horizontal menu that has the "two row" layout - where the top row contains the top level menu items and the second contains the sub menu items. When a menu item is selected from the top row I want it to look like a tab where it joins aroud the bottom row. I have looked on the web but can only find single row cascading...
5
4548
by: Chris Beall | last post by:
Objective: Using an HTML list, create a horizontal nav menu with these characteristics: - All menu items have the same width at all times. - When the window width is reduced, the menu items stack, rather than creating a horizontal scroll bar. - The menu cluster is always centered on the window. See...
2
9307
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
1
2246
by: brixton | last post by:
Hello, silly problem maybe, but... I'm trying to get a horizontal menu to work with DIVs but I'm having trouble getting the menu items to "fill" the menu DIV. Basically I have a surrounding DIV as the menu tag and then as menu items I have four DIVss, with "display:inline" in the CSS to get them to line up horizontally. What I want to do...
1
9021
by: Emil | last post by:
Hello, I'm using asp.net 2.0. I have a horizontal menu control. The children menu items are center aligned when shown. How can I change the alignment of the dynamic menu items to be left aligned? Thank you.
7
5549
by: milestogofromhere | last post by:
It is late so this is probably something really obvious but I am not seeing it. Can someone please help? Here is the page in question: html - http://www.itsyourplate.com/index2.php css - http://www.itsyourplate.com/thin.css As you can see from the file the menu is showing up vertically not horizontally. I copied the code directly from...
0
7584
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7645
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...
0
7953
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 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...
0
6263
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5485
isladogs
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...
0
5213
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...
0
3643
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...
1
2085
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
0
926
bsmnconsultancy
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...

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.