Results 1 to 2 of 2

Thread: align text in middle of menu

  1. #1
    Join Date
    Sep 2006
    Location
    Liverpool UK
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default align text in middle of menu

    Hi all,

    I have some navigation menus that are about 40px in height.

    i want to get the text for the buttons in the very center of them, when i do text-align: center; on my css it keeps them up by the top of the button and in the center, but i want it in the middle from top to bottom too.

    Help please

    geoffb

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You want vertical-align:middle; but, that generally only works in table cells. If you are using div elements, you can do something like so:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    .menudiv {
    width:10em;
    height:2em;
    padding-top:0.75em;
    text-align:center;
    border:1px solid black;
    }
    </style>
    </head>
    <body>
    <div class="menudiv">Some Text</div>
    </body>
    </html>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •