Need help centering text and line break problem {SOLVED}

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
annasue
Super Advanced
Super Advanced
Posts: 42
Joined: Thu Apr 14, 2005 11:37 pm
Location: Huntsville, AL
Contact:

Need help centering text and line break problem {SOLVED}

Post by annasue »

http://www.impressivedesignllc.com/fandw

I first of all want the each menu item to be centered within the space.

Secondly, how can I keep "practice areas" from breaking. I've tried playing with the "itemwidth", but no matter how much space I allow, it still breaks???

Thanks in advance.
Anna Sue Edwards
Webs 2 Impress
Huntsville, AL USA
http://www.webs2impress.com
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

Since you are placing the menu in a table that has a fixed width, I suggest you put in a menuwidth and itemwidth based on pixels instead of percentage.

Code: Select all

 with(milonic=new menuname("Main Menu")){
style=menuStyle;
alwaysvisible=1;
orientation="horizontal";
overfilter="";
position="relative";
menuwidth=700;
align="center";
itemwidth=138;
aI("text=Firm Overview;url=http://www.fandwlaw.com/overview.html;");
aI("text=Attorney Practices;url=http://www.fandwlaw.com/practices.html;");
aI("text=Practice Areas;url=http://www.fandwlaw.com/practiceareas.html;;showmenu=submenu1");
aI("text=Contact Us;url=http://www.fandwlaw.com/contactus.html;");
aI("text=Home;url=http://www.fandwlaw.com/index.html;");
}
drawMenus();
Try that as your embedded main menu, it stops the break and the align="center"; aligns the text in the center of each item.

Ruth
annasue
Super Advanced
Super Advanced
Posts: 42
Joined: Thu Apr 14, 2005 11:37 pm
Location: Huntsville, AL
Contact:

Reply

Post by annasue »

Ruth,

Am I missing something?

I copied only these lines of code:

Code: Select all

menuwidth=700; 
align="center"; 
itemwidth=138; 
Now this is my code:

Code: Select all

with(milonic=new menuname("Main Menu")){
style=menuStyle;
top=155;
left=200;
alwaysvisible=1;
orientation="horizontal";
overfilter="";
position="relative"; 
menuwidth=700; 
align="center"; 
itemwidth=138; 
aI("text=Firm Overview;url=http://www.fandwlaw.com/overview.html;");
aI("text=Attorney Practices;url=http://www.fandwlaw.com/practices.html;");
aI("text=Practice Areas;url=http://www.fandwlaw.com/practiceareas.html;showmenu=submenu1");
aI("text=Contact Us;url=http://www.fandwlaw.com/contactus.html;");
aI("text=Home;url=http://www.fandwlaw.com/index.html;");
}
drawMenus();
It is still not centering and my "Practice Areas" is breaking and it is not expanding to cover the 700 pixels. Those 3 lines of code were all I could see that was different other than removing the percentage codes, of course.
Anna Sue Edwards
Webs 2 Impress
Huntsville, AL USA
http://www.webs2impress.com
annasue
Super Advanced
Super Advanced
Posts: 42
Joined: Thu Apr 14, 2005 11:37 pm
Location: Huntsville, AL
Contact:

Please disregard previous message

Post by annasue »

It was operator error on my part. I appreciate so much your help, as always!
Anna Sue Edwards
Webs 2 Impress
Huntsville, AL USA
http://www.webs2impress.com
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

I suggest you take out the top and left positions. The menu is relative positioned because it's in the table and top and left have no meaning. I don't know that there is a problem with those in there, but I would bet that some browser out there will decide to be confused by the position = relative and the top and left = included. :lol:

Ruth
Post Reply