close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to center a dynamic menu

Thread began 3/05/2014 5:30 pm by kata387222 | Last modified 6/16/2014 12:02 pm by Leysart Sàrl | 667 views | 4 replies |

kata387222

How to center a dynamic horizontal menu

Hi
I have successfully centered my menu by adding a div width. Only problem is that I don't want to specify a width because I am using a database to populate the menu and don't know how wide the menu will be once my client starts populating the site.

I have tried using min-width but did not work.

I am missing something here but not sure what?



Thanks for your help.

Sign in to reply to this post

Jason ByrnesWebAssist

to center the menu, you must place the menu in a div that has the maximum width set, and use margin-left and margin-right auto

Sign in to reply to this post

Leysart Sàrl

Hello,

I'm also having problems to center my menu. I've tried with a maximum width and margin auto but does not work.

The page is online at www.leysart.com/lesnoisetiers/index.php

Here is the CSS concerned (the menu is in div HeaderMenu) :

#Header {
background-color: #ff3300;
font-size: 18px;
font-weight: bold;
height: 150px;
max-width:2000px;
line-height: 15px;
margin: 0 auto 0 auto;
text-align:center;
}
#Header #HeaderData {
font-family: "Script MT Bold";
height: 75px;
margin: 0 0 0 0; /* Sets the margin properties for an element using shorthand notation (top, right, bottom, left) */
padding: 25px 25px 0 25px; /* Sets the padding properties for an element using shorthand notation (top, right, bottom, left) */
text-align:left;
}
#Header #HeaderMenu {
height: 50px;
max-width:2000px;
margin: 0 auto 0 auto;
text-align:center;
}

Sign in to reply to this post

Jason ByrnesWebAssist

the max-width setting has to be the width of the menu.

try using 1200px for the max-width instead of 2000px.

Sign in to reply to this post

Leysart Sàrl

That solved the rpoblem. Thank you for your help.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...