By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,694 Members | 1,846 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,694 IT Pros & Developers. It's quick & easy.

problems with text align in horizontal menu

P: 2
I have a problem with making horizontal menu with css. The problem is that menu should be right aligned, but items in sub menus should be left aligned.

To make horizontal menu float:right property is used on DIV tag where menu is located.

This is an example of menu:

Expand|Select|Wrap|Line Numbers
  1. <DIV id="menu">
  2. <UL>
  3.   <LI><A>Item1</A>
  4.     <UL>
  5.     <LI><A>Item1.1</A></LI>
  6.     </UL>
  7.   </LI>
  8.   <LI>Item2
  9.     <UL>
  10.     <LI><A>item2.1</A></LI>
  11.     </UL>
  12.   </LI>
  13. </UL>
  14. </DIV>
With my style, this code is correctly displayed only in IE, in other browsers sub menus are appearing in unpredictable places. Menu formating is also correct only in IE.

page can be found here <http://nashe-vesillia.com/index_main.html>. Only IE is able to show this page in the same way as it should be.
May 21 '10 #1
Share this Question
Share on Google+
2 Replies


MusoFreak200
P: 96
hey mate...

just from a quick look i would imagine that you should be putting some end codes on stuff...

Expand|Select|Wrap|Line Numbers
  1. <div id="menu">
  2. <ul>
  3. <li><a href="#">Item 1a</a></li>
  4. <li><a href="#">Item 2a</a></li>
  5. <li><a href="#">Item Folder 3a</a>
  6.     <ul>
  7.     <li><a href="#">Sub Item 3.1a</a></li>
  8.     <li><a href="#">Sub Item 3.2a</a></li>
  9.     <li><a href="#">Sub Item 3.3a</a></li>
  10.     <li><a href="#">Sub Item 3.4a</a></li>
  11.     </ul>
  12. </li>
  13. <li><a href="#">Item 4a</a></li>
  14. <li><a href="#">Item Folder 5a</a>
  15. </div>
  16.  
hope that helps you.

cya
-MusoFreak200-
May 22 '10 #2

P: 2
@MusoFreak200
thanks for the code, but can you help with css code. How can i make right align menu, with sub menu opening when mouse is on it?
May 24 '10 #3

Post your reply

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