473,473 Members | 1,604 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Align Menu

2 New Member
I have got a menu working but i don't know how to align it to the left center of the screen. at the moment it is at the top left of the screen.

here is the code that i have got so far:

[html]
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Demo Menu 1</title>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" >

<link rel="stylesheet" type="text/css" href="sddm.css" >
<title>JSwitch Slide Menu</title>

</head>

<body>
<div class="navbar" style="width: 148; height: 253;">
<!-- *********************************Start Menu****************************** -->
<div class="mainDiv" >
<div class="topItem" >Demo Menu 1</div>
<div class="dropMenu" ><!-- -->
<div class="subMenu" style="display:inline;">
<div class="subItem"><a href="#">Configuration</a></div>
<div class="subItem"><a href="#">Tool Box</a></div>
<div class="subItem"><a href="#">Contact Us</a></div>
<div class="subItem"><a href="#">Sub Menu 4</a></div>
<div class="subItem"><a href="#">Sub Menu 5</a></div>
</div>
</div>
</div>
<!-- *********************************End Menu****************************** -->
<br>
<!-- *********************************Start Menu****************************** -->
<div class="mainDiv" >
<div class="topItem" >Demo Menu 2</div>
<div class="dropMenu" ><!-- -->
<div class="subMenu" style="display:none;">
<div class="subItem"><a href="#">Configuration</a></div>
<div class="subItem"><a href="#">Sub Menu 2</a></div>
<div class="subItem"><a href="#">Sub Menu 3</a></div>
<div class="subItem"><a href="#">Sub Menu 4</a></div>
</div>
</div>
</div>
<!-- *********************************End Menu****************************** -->
<script type="text/javascript" src="xpmenuv21.js"></script>
</div>

<p>&nbsp;</p>

</body>
[/HTML]
Feb 29 '08 #1
4 2312
ronverdonk
4,258 Recognized Expert Specialist
Please enclose any code within the approppriate code tags!

Welcome to The Scripts.

We cannot see why because your menu depends on the CSS settings. So where is the CSS definitions file?

Show it inside code tags.

Ronald
Feb 29 '08 #2
drhowarddrfine
7,435 Recognized Expert Expert
He forgot the slash on the closing [/html].

As said, we need to see the whole CSS file but, from your inline styling, it looks like you may not be setting units. Everything needs 'px' for pixels or other unit. A number alone may not work.

Also, it says you are usinng FrontPage. Make sure you have a proper doctype at the head. See the article about doctypes under Howtos at the top of this page if you don't know about them.
Feb 29 '08 #3
Toshk
2 New Member
here is the css

Expand|Select|Wrap|Line Numbers
  1. .navbar
  2. {
  3. }  
  4.  
  5. .mainDiv
  6. {
  7.   width:185px;
  8. }
  9.  
  10. .topItem
  11. {
  12.   letter-spacing: 0;
  13.   background: url('arrow-up-title.jpg') no-repeat center;
  14.   border:medium none; width:185px; height:25px; color:#215dc6; cursor:pointer; text-indent:10px; font-style:normal; font-variant:normal; font-weight:bold; font-size:12px; font-family:tahoma, verdana, sans-serif; background-repeat:no-repeat
  15. }
  16.  
  17. .topItemOver
  18. {
  19.   text-indent:10px;
  20.   letter-spacing: 0;
  21.   background: url('arrow-up-title-on.jpg') no-repeat center;
  22.   height:25px; width:185px; color:#428eff; cursor:pointer; font-style:normal; font-variant:normal; font-weight:bold; font-size:12px; font-family:tahoma, verdana, sans-serif; background-repeat:no-repeat
  23. }
  24.  
  25. .topItemClose
  26. {
  27.   text-indent:10px;
  28.   letter-spacing: 0;
  29.   background: url('arrow-down-title.jpg') no-repeat center;
  30.   height:25px; width:185px; color:#215dc6; cursor:pointer; font-style:normal; font-variant:normal; font-weight:bold; font-size:12px; font-family:tahoma, verdana, sans-serif; background-repeat:no-repeat
  31. }
  32.  
  33.  
  34. .topItemCloseOver
  35. {
  36.   text-indent:10px;
  37.   letter-spacing: 0;
  38.   background: url('arrow-down-title-on.jpg') no-repeat center;
  39.   height:25px; width:185px; color:#428eff; cursor:pointer; font-style:normal; font-variant:normal; font-weight:bold; font-size:12px; font-family:tahoma, verdana, sans-serif; background-repeat:no-repeat
  40. }
  41.  
  42.  
  43.  
  44. .dropMenu
  45. {
  46.   border-left:1px solid #FFFFFF; border-right:1px solid #FFFFFF; border-top:0px solid #FFFFFF; border-bottom:1px solid #FFFFFF; background-color: #d6dff7;
  47.   color: #000;
  48.   filter:alpha(opacity=100);
  49.   padding-top:5px;
  50.   padding-bottom:5px; font-style:normal; font-variant:normal; font-weight:bold; font-size:11px; font-family:tahoma, verdana, sans-serif
  51. }
  52.  
  53. .subMenu
  54. {
  55.    display:block;
  56. }
  57.  
  58. .subItem
  59. {
  60.    margin-left:10px;
  61.    margin-top:2px;
  62.    height:18px;
  63.    font: 11px tahoma,verdana,sans-serif;    
  64.    text-decoration:none;
  65.    color: #215dc6;
  66.  
  67. }
  68.  
  69. .subItem a
  70. {
  71.    margin-left:23px;
  72.    font: 11px tahoma,verdana,sans-serif;         
  73.    text-decoration:none;
  74.    color: #215dc6;
  75. }
  76.  
  77. .subItemOver
  78. {
  79.    margin-left:10px;
  80.    margin-top:2px;
  81.    font: 11px tahoma,verdana,sans-serif;      
  82.    height:18px;
  83.    color: #428eff;
  84. }
  85.  
  86. .subItemOver  a
  87. {
  88.    margin-left:23px;
  89.    font: 11px tahoma,verdana,sans-serif;
  90.    cursor:pointer;    
  91.    color: #428eff;
  92.    text-decoration:underline;
  93.    cursor:pointer;
  94. }
  95.  
  96.  
  97. .drop
  98. {
  99.    border-left:1px solid black;
  100.    border-right:1px solid black;    
  101. }
  102.  
Feb 29 '08 #4
ronverdonk
4,258 Recognized Expert Specialist
Replace lines 1-3 in your CSS file with
Expand|Select|Wrap|Line Numbers
  1. .navbar
  2. {
  3. margin-top: 15%;
  4. text-align: left;
  5. }  
Ronald
Mar 1 '08 #5

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

Similar topics

3
by: Mark | last post by:
Ok, it is starting to get somewhere, but i am not sure what to do with the following problem: I designed "knobs". They are 90px in width and do have one border (right) of 1px. So i guess, within...
11
by: Dan | last post by:
Hello all, I am getting records from a db and displaying the records to the user through a drop down menu in an asp page. Each record has 6 fields and I need to display them all to the user in...
3
by: Mike Stephens | last post by:
This is very simple and for the life of me the solution escapes me. How can I align a context menu to the right button of a button? Regards, Mike
2
by: chris_culley | last post by:
Hi, I'm fairly new to using css, and have been using it to format a vertical navigation bar on my website, producing a load of buttons on top of each other, each with a (151 * 33 px) gif as the...
4
torquehero
by: torquehero | last post by:
Hi all :) I have created a horizontal navbar using Xara Menumaker. The Menu items have several dropdown menus. Its a javascript. When the mouse cursor is moved over any menu item, a dropdown...
1
by: Steve Richter | last post by:
I am using <div align=centerto center a horizontal menu on the page. Problem is the center align of the div is rippling down to the menu items and causing the text of the dynamic popup sub menu...
3
by: smitb | last post by:
Hi, I am a CSS/HTML novice. Can anyone please answer my question. I am trying to insert a small image(an arrow) within an <li> tag. My problem is that I cannot right align the image. Here is...
13
by: Bill | last post by:
Hi How can I have IE7 act correctly on that ? The rules make the link text go down when hovered. It works in FF , I had to add a hard space right after the LI tag to have OP9 work but I can't...
1
by: panos100m | last post by:
I cant put the text (register,members,find) in the center of the three buttons using Internet explorer... Any help will be much appreciated (html code below) <td class="ct"> <!-- menu...
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
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
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
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...
1
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
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.