Here is the best solution I have found that works for all resizing. It centers the elements of the 5 upper beams.
Note that the keep-to-grid div will maintain the width of the top-level navigator within the website, but will not actually center the navigation elements.
The code used below.
SCSS:
nav.top-bar:not(.expanded) { text-align: center; section.top-bar-section { display: inline-block; } }
HTML:
<div class="contain-to-grid"> <nav class="top-bar" data-topbar> <ul class="title-area"> <li class="name"> <h1><a href="#"></a></h1> </li> <li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li> </ul> <section class="top-bar-section"> <ul> <li><%= link_to 'LINK 1', root_path %></li> <li class="divider"></li> <li><%= link_to 'LINK2', link_path %></li> <li class="divider"></li> <li class="has-dropdown"> <%= link_to 'Dropping', "#" %> <ul class="dropdown"> <li><label>Label:</label></li> <li><%= link_to 'DROP 1', drop_path %></li> <li class="divider"></li> <li><%= link_to 'DROP 2', drop_path %></li> </ul> </li> </ul> </section> </nav> </div>
source share