html list items horizontally with flexbox

Solutions on MaxInterview for html list items horizontally with flexbox by the best coders in the world

showing results for - "html list items horizontally with flexbox"
Eloise
28 Nov 2017
1for example: 
2(html)
3<ul class="navbar-items">
4	<li> <a href="#start">Start</a> </li>
5    <li> <a href="#profile">Profile</a> </li>
6    <li> <a href="#projects">Projects</a> </li>
7    <li> <a href="#info">Info</a> </li>
8</ul>
9
10(css)
11ul.navbar-items /* Important part */
12{
13    display: flex;
14    align-items: stretch; 
15    justify-content: space-between;
16    width: 100%; /* play with this number to get spacings correct */
17}
18
19ul.navbar-items li /* Extra part, to style each item */
20{
21    padding: 10px;
22}