473,503 Members | 2,150 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

menu nowrap

pradeepjain
563 Contributor
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
Sep 6 '08 #1
1 5752
SAF22
6 New Member
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!
Sep 8 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

22
11058
by: Marek Mand | last post by:
How to create a functional *flexible* UL-menu list <div> <ul> <li><a href=""></li> <li><a href=""></li> <li><a href=""></li> </ul> </div> (working in IE, Mozilla1.6, Opera7 (or maybe even...
0
15174
by: Mark Moore | last post by:
I'm trying to layout a couple text input fields and their corresponding labels without using a table. When I was trying to debug my understanding of CSS, I was *very* surprised to see that span's...
2
6631
by: Nathan Sokalski | last post by:
I want to create TD tags with the nowrap property. I have a user control which sets the Wrap property of a TableCell to False when dynamically creating a table as follows: cellCurrButton.Wrap =...
1
1778
by: ward | last post by:
Good morning everyone. I'm building a very simple content management site that tracks "tasks." The options available are: 1. Add Task 2. Edit Task 3. View Task 4. Print Task
1
6598
by: camphor | last post by:
hi, I have a single column webpage with a horizontal dropdown menu and am trying to make the nav bar fit across the page, the column is 800px, it looks ok in dreamweaver 8 but when I test it in...
7
2216
by: Terry | last post by:
Hi again folks. I have a couple of issues now. I am not sure why I can't get my menu to overlap the content area. I tried using z-index. The effect I want occurs in Firefox but not IE. ...
0
3114
by: mjohnson0321 | last post by:
I am trying to incorporate a CSS drop-down menu into a site (suckerfish menu). The menu gets lost behind the content below it, but only on one of the drop downs (News). The error occurs on all of...
5
5824
by: jerry101 | last post by:
Hi, I've been working on a horizontal drop down menu today, and I can get it to display perfectly in everything bar IE6. Basically instead of them lining up horizontally, they line up...
0
3212
by: anand4160 | last post by:
i use nowrap="nowrap" attribuate to fix my UI for IE 6 , now when i am trying to run the same code in IE 8 its not working. The code is simple to display table. nowrap="nowrap" is written in...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5594
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4688
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
746
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
399
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.