Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:36

Menu Style Property (for reducing letterspacing)


Poster: TimBert
Dated: Sunday March 21 2004 - 23:45:48 GMT

Is there a style property I can use with the menu to condense the font spacing?


Poster: kevin3442
Dated: Wednesday March 24 2004 - 0:07:34 GMT

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

style property to condense the font


Poster: TimBert
Dated: Wednesday March 24 2004 - 19:40:45 GMT

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?


Poster: John
Dated: Wednesday March 24 2004 - 20:30:07 GMT

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.

Re: style property to condense the font


Poster: kevin3442
Dated: Wednesday March 24 2004 - 21:04:58 GMT

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:
<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:
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:
aI("text=Item Text;url=whatever.htm;onclass=menuClass;offclass=menuClass;");


Hope that clarifies it.

Kevin

Kevin


Poster: TimBert
Dated: Wednesday March 24 2004 - 21:53:19 GMT

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


Poster: kevin3442
Dated: Wednesday March 24 2004 - 22:00:19 GMT

Exactly the same way.

Kevin


Poster: TimBert
Dated: Wednesday March 24 2004 - 22:18:49 GMT

Done!

Thanks again