The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Centering logo inside dynamic menu

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #45507

    Well, I am trying to create a responsive layout and I need to center the logo inside a horizontal menu. I already found a solution for this here on css-tricks forum, but it doesn’t solve my “dynamic” issue. The menu will be for a cms where I can’t control the number of links inside it. I tried to add left margin to the nth-child(4) but when the user adds more than 8 links in total it goes crazy. I added below a pen with the html structure and some css, I left the js blank for you to have some fun. I was thinking of splitting the menu in 2 ul-s and move the html structure for the logo in between, but I don’t like the idea. I hope you guys will come up with something.

    [Codepen Link]( “Codepen Link”)

    Thanks! And sorry for my english.


    what do you want to happen when there is an odd number of links?


    That’s another problem. Lets say there are 7, the first four should be on the left and the rest on the right.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Other’ is closed to new topics and replies.