开发者

Vertically Center Navigation UL LI

开发者 https://www.devze.com 2022-12-14 01:30 出处:网络
I wish to开发者_开发问答 make the all the list items to be centered. or at least 20 pixels from the top.

I wish to开发者_开发问答 make the all the list items to be centered. or at least 20 pixels from the top.

I have tried negative margin-top but that didn't work.

Any suggestions?

Here is the site. http://freddygonzalez.me/dev/85


The simplest way to do this is to remove display: inline and margin-top and add the following rules to the li elements:

float: left;
line-height: 49px;

Note that this won't work if a menu item can have two lines of text.

0

精彩评论

暂无评论...
验证码 换一张
取 消