wanted: 5 mainitems each 20% width

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
vlerk@chello.nl
Beginner
Beginner
Posts: 6
Joined: Thu Nov 27, 2003 3:53 pm

wanted: 5 mainitems each 20% width

Post by vlerk@chello.nl »

Hi,

I try to make a horizontal menu with 5 mainitems each 20% width so they wil scale. Now the mainitems are images 150px width, and I would like (comparing with table) the 'cells' to be 20% each.

[/url]http://www.oplijn.nl/sp_mimenu[url] I studied several samples but did not ... lue. Grea[/url]
vlerk@chello.nl
Beginner
Beginner
Posts: 6
Joined: Thu Nov 27, 2003 3:53 pm

Post by vlerk@chello.nl »

User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Grea,

As far as I know, the itemwidth property doesn't support widths specified as percentages (I just tried it, and it didn't work). The description of itemwidth says:
itemwidth is an optional property that will fix the width of a menu based on declared pixel values. If this value is ommited, the menu will calculate the best width to use.
It seems to be specific to number of pixels. Percentages would be a nice touch though.

One option you could try is, in the main menu definition, remove any itemwidth setting, and define:

Code: Select all

menuwidth="100%";
menualign="center";
Your main menu bar would span the entire width of the browser window, with the "active" part of the menu centered, and with extra space added equally to the left and right sides. As you make the window narrower, the extra space on either side would shrink, and the menu items themselves would remain centered on the page. Similarly when making the window wider... extra space added equally to either side, with the menu items centered in the page.

Kevin
vlerk@chello.nl
Beginner
Beginner
Posts: 6
Joined: Thu Nov 27, 2003 3:53 pm

Post by vlerk@chello.nl »

Thanks for your answer Kevin.
I did try those possibilities before posting the question and was hoping I missed a clue in the 100% span sample.

Precentage-itemwidth would be great indeed, for now I have to think of something else.
May be do some expiriments with 5 (main) menu's in a row... Anyone done this before?

Grea
vlerk@chello.nl
Beginner
Beginner
Posts: 6
Joined: Thu Nov 27, 2003 3:53 pm

Post by vlerk@chello.nl »

Tadaaaaaa it's working.

Using the 'Relative Positioning / Table Bound' sample I achieved what I was looking for. Don't know what I did wrong last week but who cares.

So it is possible to give the mainmenuitems a % width using the traditional tablecells with css.

Grea
Post Reply