473,396 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Positioning problem with a menu

Stang02GT
1,208 Expert 1GB
I have created a menu ( as some of you may have seen in my previous post about adding a third level to a 2 level menu) and now my problem with the menu is that the menu stretches across the whole screen and i would like to position it directly in the center of the screen and fit between a certain area.


Is there a way threw the CSS file or maybe something that i can add into the HTML file that i can move the position of the menu and have i need it to not go past a certain spot on the right on of screen. (the menu will adjust it's self based on the size of the screen, if the screen is shrunk the menu moves the times that would be cut of to a second row)

here is my css file

Expand|Select|Wrap|Line Numbers
  1. .horizontalcssmenu ul{
  2. margin: 0;
  3. padding: 0;
  4. list-style-type: none;
  5. }
  6.  
  7. /*Top level list items*/
  8. .horizontalcssmenu ul li{
  9. position: relative;
  10. display: inline;
  11. float: left;
  12.  
  13. }
  14.  
  15. /*Top level menu link items style*/
  16. .horizontalcssmenu ul li a{
  17. display: block;
  18. width: 120px; /*Width of top level menu link items*/
  19. padding: 2px 8px;
  20. border: 1px solid #202020;
  21. border-left-width: 0;
  22. text-decoration: none;
  23. background: url(untitled.bmp) center center repeat-x;
  24. color: white;
  25. font: bold 10px Tahoma;
  26. }
  27.  
  28. /*2nd level menu*/
  29. .horizontalcssmenu ul li ul{
  30. left: 0;
  31. top: 0;
  32. border-top: 1px solid #202020;
  33. position: absolute;
  34. display: block;
  35. visibility: hidden;
  36. z-index: 100;
  37. }
  38.  
  39. /*2nd level menu list items*/
  40. .horizontalcssmenu ul li ul li{
  41. display: inline;
  42. float: none;
  43. }
  44.  
  45.  
  46. /* 2nd level menu links style */
  47. .horizontalcssmenu ul li ul li a{
  48. width: 130px; /*width of sub menu levels*/
  49. font-weight: normal;
  50. padding: 2px 5px;
  51. background: url(untitled1.bmp) center center repeat-x;
  52. border-width: 0 1px 1px 1px;
  53. }
  54.  
  55. .horizontalcssmenu ul li a:hover{
  56. background: url(untitled1.bmp) center center repeat-x;
  57. }
  58.  
  59. .horizontalcssmenu ul li ul li a:hover{
  60. background: url(untitled2.bmp) center center repeat-x;
  61. }
  62.  
  63. .horizontalcssmenu .arrowdiv{
  64. position: absolute;
  65. right: 0;
  66. background: transparent url(menuarrow.gif) no-repeat center left;
  67. }
  68.  
  69. * html p#iepara{ 
  70. padding-top: 1em;
  71. }
  72.  
  73. /*3rd level menu*/
  74. .horizontalcssmenu ul li ul li ul{
  75. left: 0;
  76. top: 0;
  77. border-top: 0px solid #202020;
  78. position: absolute;
  79. left: 30px; /*this is the offset for the sub sub-menu to allow the sub-menu to be seen*/
  80. display: block;
  81. visibility: hidden;
  82. z-index: inherit;
  83. }
  84.  
  85. /*3rd  menu list items*/
  86. .horizontalcssmenu ul li ul li ul li{
  87. display: inherit;
  88. float: right;
  89. }
  90.  
  91.  
  92. /*3rd  menu links style */
  93. .horizontalcssmenu ul li ul li ul li a{
  94. width:120px; /*width of sub menu levels*/
  95. display:block;
  96. font-weight: normal;
  97. padding: 2px 2px;
  98. background:  url(untitled.bmp) center center repeat-x;
  99. border-width: 0 1px 1px 1px;
  100. }
Dec 21 '07 #1
3 1548
Death Slaught
1,137 1GB
Have you tried putting the entire thing into a division, and adding this:

Expand|Select|Wrap|Line Numbers
  1.  text-align:center;
If this gives you the desired effect, but doesn't quite fit in the area you wanted, just reduce the width a little.

Hope it helps, Thanks, Death

*EDIT* You could just give it an absolute positioning, and then move it where you want it.
Dec 21 '07 #2
drhowarddrfine
7,435 Expert 4TB
The CSS doesn't mean anything without the html.
Dec 21 '07 #3
Death Slaught
1,137 1GB
The CSS doesn't mean anything without the html.
True, however, his problem does not lie within his HTML, or really have much to do with it. His problem is positioning, which is CSS. Although having the HTML so we may see what space we have to work with would have been nice (not to mention make our lives slighty easier). I believe that he provided enough information so we could provide a decent assumption, and therefor provide ways of accomplishing his goal (based entirely upon that assumption of course).

I understand what your saying so just ignore my rant above :)

Thanks, Death
Dec 21 '07 #4

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

Similar topics

16
by: Vincent | last post by:
First, here is a page to help you figure out what I'm talking about: http://relinquiere.free.fr/test.html As you can see in the source of this page, the structure is the following : - a banner...
5
by: Alec S. | last post by:
Hi, Can EMs be used for positioning? For example: #navbar { left: 2em; top : 1.3em; }
6
by: Michael Rozdoba | last post by:
I've had some trouble getting IE to behave in respect of applying absolute positioning to a span on an a:hover. I can get it to work, but I don't understand why certain code causes it to fail to...
4
by: CJM | last post by:
I'm developing a web application, that has a left-sided navigation menu and a centre-right content area. The menu is static and therefore is in an INCLUDEd file. I'm wanting to add a link to a...
1
by: RWC | last post by:
Hey Folks! I'm having trouble with an asp page. First off, I'm new to the html / asp world, but not to software development. I'd like to minimize or "normalize" the site, so I'm trying to use...
4
by: Darren | last post by:
hi all. probably a trifle put google didn't tell me much. I notice there are size units such as 'pt' and 'px'. is there one that will position the same regardless of browser size, screen...
2
by: Andre | last post by:
Hi, I need help with something's working in one of my app, but not in another. I have a MENU, and on MouseOver i display a DIV on the Page, but in Firefox, the DIV is always at the LEFT (0px)...
0
by: slaterino | last post by:
Hi, I am in the process of creating a web site at the following address: http://www.cca-ltd.co.uk/New/en/index.html At the moment when you hover over the navigation links a list appears on the...
4
by: Christopera | last post by:
Hello, I have built a site that uses two divs, one verticle, and one horizontal as graphic style for the ite. The problem I am having is that if the browser is resized very small the divs are...
2
by: fjohnson | last post by:
Hello, I have a CSS Horizontal dropdown menu and the drop down menu is pushed to the right instead of directly underneath the heading. I am completely new to CSS and I do not yet know exactly what...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
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,...

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.