K
K
KurtsKhalia2014-09-15 22:30:22
Design
KurtsKhalia, 2014-09-15 22:30:22

How do you vertically align elements with text?

It is often necessary to align an element with text vertically in a graph. editor, and thought about how to align correctly: including the protruding lines of letters or not.
Suppose there is a letter "b" at the top of the element being aligned, or at the bottom "r", and you make even indents from the protruding parts or from ordinary letters?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
N
Nazar Mokrinsky, 2014-09-16
@KurtsKhalia

Most likely, do not take into account the bottom, but take into account the top (there are still capital letters).
In general, editors usually have mutual alignment buttons, in browsers, depending on the situation, I use either vertical-align:middle or flexbox. I didn’t even think about what exactly it aligns, just see how it looks better.

Y
Yuri Lobanov, 2014-09-18
@iiil

Everything depends on the situation. You are trying to cover too much area with a question, vertical alignment is detailed in many typography books.
Are you familiar with the concept of visual weight?

N
Neron, 2014-10-07
Lordov @Nekto_Habr

It is necessary to align on the baseline, obviously. On the fingers: let's take two words - bug and humus, the base line will run from "b" to "c", being located closely below them, crossing the legs of the letters "y".

D
Deleted Deleted, 2014-10-16
@DailyFuckups

display:inline-block; vertical-align:???;
Ready.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question