Menu Style Property (for reducing letterspacing)

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
TimBert
Advanced
Advanced
Posts: 22
Joined: Tue Feb 10, 2004 5:18 am
Location: Calgary AB, Canada (ex-Leicester)
Contact:

Menu Style Property (for reducing letterspacing)

Post by TimBert »

Is there a style property I can use with the menu to condense the font spacing?
Last edited by TimBert on Wed Mar 24, 2004 8:42 pm, edited 1 time in total.
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 Tim,

I'm no CSS guru, but it seems to me that you could use the onclass and offclass properties (style or item), and in the specified css styles, set letter-spacing how you want (it takes negative values, which is what I guess you'd use to squeeze the text closer together). Haven't tried it myself, but it's worth a shot. Here's a ref:

http://www.style-sheets.com/tutorials/t ... pacing.asp

Hope that helps,

Kevin
TimBert
Advanced
Advanced
Posts: 22
Joined: Tue Feb 10, 2004 5:18 am
Location: Calgary AB, Canada (ex-Leicester)
Contact:

style property to condense the font

Post by TimBert »

Hi Kevin,

Just in case there is any confusion, I was not inquiring about a CSS style for my site but a rather a style property for my floating double menu.

I have already tried both of the following:

fontstretch="condensed";
letter-spacing="-1px"; (or em or %)

neither work and the latter causes the menu to dissapear altogether (in the browser, that is).

So, anyone else got any other ideas?
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Both of those are, I believe, css items, not menu parameters. You could make a stylesheet with those items, and then call it as Kevin suggested.
John
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Re: style property to condense the font

Post by kevin3442 »

Hi Tim,
TimBert wrote:...Just in case there is any confusion, I was not inquiring about a CSS style for my site but a rather a style property for my floating double menu...
Yep... I understood. I guess I just didn't explain what I meant very well. The menu system has no built-in property to do what you want. Fortunately, however, there are ways to do it through CSS, and the menu system's onclass and offclass properties let you hook CSS into the menu.

So, you can create a class that specifies the letter-spacing CSS property, like so:

Code: Select all

<style>
.menuClass {
letter-spacing: -1px
}
</style>
Then you can apply it to your menu by putting the following two lines in the menu style:

Code: Select all

onclass="menuClass";
offclass="menuClass";
If defined in a menu style, like above, then your new .menuClass will be applied to any menu that uses that particular menu style. Alternatively, you could apply it item-by-item by specifying onclass and offclass in a menu item's aI() string, like so:

Code: Select all

aI("text=Item Text;url=whatever.htm;onclass=menuClass;offclass=menuClass;");
Hope that clarifies it.

Kevin
TimBert
Advanced
Advanced
Posts: 22
Joined: Tue Feb 10, 2004 5:18 am
Location: Calgary AB, Canada (ex-Leicester)
Contact:

Kevin

Post by TimBert »

That worked! Thanks

At the moment I have:
<style>
.menuClass {
letter-spacing: -1px
}
</style>
right in the head of the page, but I would like to put it into the style sheet.

How would I then link to .menuClass in the style sheet from:
onclass="menuClass";
offclass="menuClass";
in the menu
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Exactly the same way.

Kevin
TimBert
Advanced
Advanced
Posts: 22
Joined: Tue Feb 10, 2004 5:18 am
Location: Calgary AB, Canada (ex-Leicester)
Contact:

Post by TimBert »

Done!

Thanks again
Post Reply