F
F
freeman02042015-10-04 15:23:23
css
freeman0204, 2015-10-04 15:23:23

How to align block position: absolute; in the center?

You need to make such a header screenshot.ru/87a75f16a0a8047746cf2202b561b1d8 gave the logo position: absolute; to knock it out of the flow and place it between the menu, but he does not want to become centered, even if you write
left: 50%;
margin-left: 585px;
How to put the logo block in the center? and maybe you have a better idea to implement such a hat?
Forgot to give codepen.io/anon/pen/epvPqM

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Turovnikov, 2015-10-04
@freeman0204

You obviously made a mistake with the indent, if you want to make it in the center, then if the logo is 50x50:

left: 50%;
margin-left: -25px; /* половина ширины logo */

or instead of margin
transform: translateX(-50%);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question