L
L
larka_skaz2018-09-10 16:34:03
HTML
larka_skaz, 2018-09-10 16:34:03

Why is the caption not centered vertically (visually raised 2 pixels up)?

https://codepen.io/Larka_Ska/pen/oPEjoW
Actually, I don't have a solid knowledge of css, because of this I can't understand why the inscription on the purple button is creeping up.
I think there is something wrong with the line-height... or maybe not.
It is important that the button is 40px high and the caption is 15px high, i.e. the height of the letters and padding should end up being 40px. It is impossible to set the height of the div in which the button is placed in these 40 px.
ps do not pay attention to the fact that the sandwich icon is blurry. It will be 40 by 40 px in svg in the end.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
BigSmoke, 2018-09-10
@larka_skaz

Line - height can be removed, and for added.menu-button a.menu-button

display: flex;
align-items: center;

K
Kirill Shulgin, 2018-09-10
@Nodok

a {
  position: relative;
  top:1px
}

I think that it was the underlining from the link (it remained on hover) and took 1px

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question