Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Center div between middle and left

I have a logo aligned in the center, and when I adjust the screen/window width it keeps in the center perfectly. To the left of the logo I have a small menu with only two words, I want this menu/div to always be between the logo and the left edge.

Can this be done with only CSS?

To consider is that the logo has its own widht 200px but I can fix this with margin-left: -100px;. And when it comes down to a screen size where it no longer fits to the left!, I will put it under the logo with @media screen and (max-width: px) { ... }.

Like this: http://postimg.org/image/v148gyc9b/

like image 834
Fredrik Avatar asked Oct 20 '22 19:10

Fredrik


1 Answers

If the logo has a fixed size of 200px, you can try something like this :

#menu {
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc(50% - 100px);
}
like image 90
Franz Avatar answered Oct 22 '22 22:10

Franz