How do you center a menu bar in Dreamweaver? | Programming, .NET, Silverlight & More

How do you center a menu bar in Dreamweaver?

I need to know how to center my horizontal menu bar in Dreamweaver. Detailed instructions, and html code if needed, would be greatly appreciated. Thanks!

in the "Design View" you can right click on the horizontal menu bar that you implemented and click align->center. Dreamweaver will add a div around your code like this:

<div align="center">
…code
</div>

if that doesn’t work you can try this CSS code:

<div style="margin:0 auto;">
…code…
</div>

this css style should automatically set the right and left margins to be the same (meaning the menu is in the center of the page.)

If it is still slightly to the left add:

<div style="margin:0 auto; padding-left:10(or the amount it is off in pixels)px">
…code…
</div>

No TweetBacks yet. (Be the first to Tweet this post)

One Response

  1. Nate O Says:

    in the "Design View" you can right click on the horizontal menu bar that you implemented and click align->center. Dreamweaver will add a div around your code like this:

    <div align="center">
    …code
    </div>

    if that doesn’t work you can try this CSS code:

    <div style="margin:0 auto;">
    …code…
    </div>

    this css style should automatically set the right and left margins to be the same (meaning the menu is in the center of the page.)

    If it is still slightly to the left add:

    <div style="margin:0 auto; padding-left:10(or the amount it is off in pixels)px">
    …code…
    </div>
    References :

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.