D
D
Dialog2010-11-01 20:06:42
css
Dialog, 2010-11-01 20:06:42

css and text vertical alignment

actually the question is this - I make up the menu, respectively, through ul and li. there are multi-line items, lines are separated by br's. the problem is that the height of the paragraph is fixed, and the text is allowed in 2 lines not centered. searching the Internet, I found only about vertical-align and line-height, the first effect is zero, the second did not suit. how to do it right?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
slang, 2010-11-01
@slang

Yes, you need to change the display property, here phrogz.net/css/vertical-align/index.html explains how it works well.

D
Dmitry Rublev, 2010-11-01
@dmitryrublev

vertical-align applies to table elements, so the effect is null for a list.
You can try playing around with the "display" property of the elements.

W
WilliamKidd, 2010-11-01
@WilliamKidd

Yes, you need to do li{display:inline-block} (google how to do crossbrowser), then vertical-align:middle will work.

A
almazmusic, 2010-11-02
@almazmusic

habrahabr.ru/blogs/css/71236/ as one of the methods.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question