close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

can't center CSS menu

Thread began 12/02/2009 3:49 am by Nathon Jones Web Design | Last modified 9/12/2011 7:38 am by Jason Byrnes | 6917 views | 20 replies |

Nathon Jones Web Design

can't center CSS menu

Hi. I can't center my CSS Menu.
I've followed the instructions provided here:
mw_centering_menu_ht.pdf

...and I've also enclosed my CSS Menu include file in a center aligned div:

<div id="violinheaderbtns">
<div align="center">
<!--#include file="CSSMenuWriter/cssmw/menu.asp" -->
</div>
</div>

Here's a link to an example:
contact-violin-shop-hexham.asp

How do I center the menu? Would appreciate any advice. Thank you.
Regards
Nathon.

Sign in to reply to this post

neilo

I think the list (technically) is centred.

You just need to remove the border-right from the last item in the list.

Sign in to reply to this post

Nathon Jones Web Design

not possible

You can't remove the border-right from just one button though, can you.

Sign in to reply to this post

neilo

Possible

EDIT: Sorry, have deleted this because it was twaddle. Too embarrassed for words.

Sign in to reply to this post

Jason ByrnesWebAssist

another way to go about it is to define the border right style inline for the last item:

<li><a href="contact_violin_shop_hexham.asp" style="border-right: 0px;">Contact Us</a></li>
Sign in to reply to this post

neilo

Ha - a tad simpler! I do feel silly. Cheers. Jason, - I appreciate your diplomacy.

Sign in to reply to this post

Nathon Jones Web Design

missing the point?

I think you're both missing the point though. Taking the far right border away doesn't center my menu, it just gives the impression that it's centered because you can't see the last border line.

How do I center the menu?

Sign in to reply to this post

bjgarner241692

I'm struggling with the same issue. On other sites I have simply centered the cell that the nav include is in but on the site I am working on now this does not work.

I've even tried placing it in a div and centering the text with
text-align: center!important;

but it still is left justified.

Forcing left justify produces awkward results when the page names are of varying lengths. Centering the entire menu and the text on each button gives a more balanced appearance.

Sign in to reply to this post

neilo

Hi Nathon,

The items are AP divs set to relative positioning.

You can force it to centre, by adding a 5px margin to the first item.

<li><a href="index.asp" style="margin-left: 5px;">Home</a></li>

Alternatively, you could add 5px padding-left to your violinheaderbtns div.

#violinheaderbtns {
clear: both;
width: 980px;
margin-right: auto;
margin-left: auto;
text-align: center;
padding-left: 5px;
}
Sign in to reply to this post

Nathon Jones Web Design

not possible?

I appreciate the effort neilo, but it strikes me that this is just another cheat way of doing it.

Is it just not possible to center a CSS Menu Writer menu on a page?

Sign in to reply to this post
loading

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...