Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old September 6th, 2008, 08:19 AM
pradeepjain's Avatar
Familiar Sight
 
Join Date: Jul 2007
Location: India
Age: 24
Posts: 244
Default menu nowrap

Hii guys i am using this menu for my site.

http://www.cssplay.co.uk/menus/final_drop.html


My problem is that when i have a text like "Contact us" for menu item it wraps around in IE but its fine in firefox .For primary item the link must not wrap and for secondary item if the link wraps its ok.I tried the css property white-space: no-wrap
like this
Expand|Select|Wrap|Line Numbers
  1. /* style the links for the top level */
  2. #menubar a, #menubar a:visited {
  3. display:block;
  4. font-size:11px;
  5. font-weight: bold;
  6. text-decoration:none;
  7. color:#fff;
  8. height:15px;
  9. background-color:#859fcf;
  10. margin: 5px 3px 0 15px;
  11. /*margin: 1px 3px 0 30px;*/
  12. }
  13. /* a hack so that IE5.5 faulty box model is corrected */
  14. * html #menubar a, * html #menubar a:visited {
  15.  width:20px;
  16.  w\idth:20px;
  17.  margin: 5px 3px 0px 15px;
  18. white-space: no-wrap;
  19.  }


but its taking for the second level link also ...i want the nowrap to work for the primary links only...


thanks,
Pradeep
Reply
  #2  
Old September 8th, 2008, 11:44 AM
Newbie
 
Join Date: Aug 2008
Posts: 6
Default

If I'm understanding you correctly..

This may not be the best method, and please correct me if I am wrong. However it may get you what you're looking for.

Instead of applying the style to the entire id in your stylesheet, perhaps add the style to your <li> (or possibly the <a href>) in the HTML? So you would have something like...

Expand|Select|Wrap|Line Numbers
  1. <ul>
  2. <li style="white-space:no-wrap"><a href="contact.html">Contact Us</a></li>
  3.      <ul>
  4.      <li><a href="secondarylink.html">Link 1</a></li>
  5.      <li><a href="secondarylink.html">Link2</a></li>
  6.      </ul>
  7. </li>
  8. </ul>
  9.  
Then remove the white-space property from your css. I'm not entirely sure if that property would fix your problem to begin with though.

Anyways, this is how I've handled individual elements in the past and it validates strict for me!

Maybe some more code, or a URL would be nice!

Hope it can help you at all!
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles