html - Vertical menu with stacked text -


i have created fixed vertical menu stacked text jsfiddle

each of sections 100% height. wasn't sure if correct way things, used span elements , set them display: block;

<a class="page-scroll" href="#header">     <span> h </span>     <span> o </span>     <span> m </span>     <span> e </span> </a> 

now have kind of works, seeing dealing 100% heights each section, trying place menu vertically aligned within middle of container. have tried using property on ul not move whole menu middle.

i thinking using margin top of 50%, if add more items menu may not work. additionally, if did add more items menu, there way of ensuring whole menu displayed within viewport, not overlapping section? have updated jsfiddle demonstrate mean. because have added couple of menu items menu, test2 seems disappear because not fit viewport. there way can avoid this?

any advice appreciated.

thanks

use flexbox it. have add 100% height .navbar element , following settings .navbar-nav:

.navbar-nav {     height: 100%;     display: flex;     flex-direction: column;     justify-content: center;     flex-wrap: wrap; } 

https://jsfiddle.net/n4p9hknu/2/

if there more menu list items fit on page, flex: wrap cause them wrap second column: https://jsfiddle.net/rubgowpa/1/


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -