padding-left? identation?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
cpriest
Advanced
Advanced
Posts: 17
Joined: Mon Sep 13, 2004 6:38 pm

padding-left? identation?

Post by cpriest »

I've looked through the files but couldn't find an answer...

Is there any way I can indent a menu item with some property?
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Depending on how much you want, most folks just use  . Another way is with the rawcss property and a padding-left value.
John
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,

Something that used to work, then didn't for several releases, but does again is to use css-like syntax in the menu's padding property, in the menu style or in anu individual menu item definition. Like so:

In a style:

Code: Select all

padding="5px 5px 5px 15px";
In a menu item:

Code: Select all

aI("text=Item Text;url=whatever.htm;padding=5px 5px 5px 15px;");
You can use other units of measure instead of px, or if you want to use px, you could omit it entirely since px is the default.

I do not know if this approach is officially supported, but I just tested it in IE6 and it does work.

FWIW,

Kevin
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

The following seems to work in IE5.5 win98se, Netscape 7.1, Firebird [fox].07, Opera 7.11, I do not know if it works on a Mac.

Declare a css class and then call it in the item you want to indent using the offclass and onclass parameters of the menu. For example [ I put it in the head of the document, but I would assume if you have a style sheet you can put it there]

Code: Select all

<style type="text/css">.menuindent {text-indent:15px;}
</style>
Then in the menu, in the item you wish to have indent:

Code: Select all

aI("text=Home;url=http://milonic.com/;status=Back To Home Page;offclass=menuindent;onclass=menuindent;");
I used the 15px so I could actually see if it worked.

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

Post by kevin3442 »

Ah yes... Ruth has a good idea there! Forgot about onclass and offclass. Just to add, you can also set onclass and offclass in a menu style, rather than having to set it in each aI() string. Might save a little typing.

Cheers,

Kevin
Post Reply