简体   繁体   English

垂直spry菜单栏文本不会垂直居中

[英]Vertical spry menu bar text won't center vertically

I know I have gotten past this this before a long time ago but I can't seem to recall what I did. 我知道我很早以前就已经克服了这一点,但是我似乎无法回忆起自己的所作所为。 The text in the the buttons for the vertical spry menu bar can be aligned horizontally with text-align but I've tried to vertically align and have gotten nothing using the vertical align. 垂直spry菜单栏按钮中的文本可以与text-align水平对齐,但是我尝试垂直对齐,但是使用垂直对齐没有任何帮助。 I'm wondering if there is a property I need to define first or if I'm just being an idiot and missing it entirely. 我想知道是否需要首先定义一个属性,或者我只是一个白痴而完全错过了它。 It is an update for www.eauclairetowing.com using a vertical spry menu bar not unlike the one currently on there. 这是对www.eauclairetowing.com的更新,其中使用了垂直的敏捷菜单栏,与当前的菜单栏没有什么不同。

I see your answers. 我看到你的答案。 I am currently at work but will try them on my lunch break. 我目前正在上班,但是在午餐时间尝试一下。 This site is going to be my new found love :D 这个网站将成为我新发现的爱:D

If your menu items are in single lines only (no line breaks), give them a line-height that is equal to the height of the menu item. 如果您的菜单项仅位于单行中(没有换行符),请为其设置行高,该行高应等于菜单项的高度。

Example: 例:

.menu li a { 
  height: 100px;
  line-height: 100px;
}

If it has more then one line per menu item, give it the display of table-cell and give it a vertical-align: middle 如果每个菜单项有多于一行,则给它显示表格单元格并使其垂直对齐:中

.menu li a {
  display: table-cell;
  vertical-align: middle;
}

Use padding-top like you've done in the current site: 像在当前站点中一样使用padding-top:

ul.MenuBarHorizontal a {
  padding-top:0.5em
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM