0

enter image description here

I have trouble to center align text (horizontal and vertical) on the dynamic navigation buttons. The buttons have set with and height that makes the button to have single or double line of text. I want the text center align either if there is single or double-row of text.

Right know I have "sheated" styled the buttons with double line of text with "top-margin" manually (see CSS declaration below),

#access li#menu-item-21 a {
    margin-top:3px; line-height:1.2em; height:27px;
}

But I don't want to set specific CSS declaration on the button with 2 rows of text.. I want to set same #access a styling for all the buttons..Is that possible to achieve this look?

link to my page

Should be a better way to solve that.

4

1 回答 1

1

你有几个#access a定义。用这个替换它们:

#access a {
    color: #fff;
    text-decoration: none;
    display:table-cell;
    vertical-align:middle;
    height: 35px;
    width:85px;
    text-align: center;
    line-height: 1em;

}

并摆脱#access li#menu-item-21 a2 个订单项的定义。

于 2013-10-02T18:34:08.953 回答