It feels really repetitive to have to add margin classes to each LI manually on a non-dynamically generated menu. It almost seems as messy as using inline style attributes...
Is there a more efficient way to handle this?
While it may not be a big deal for a small menu, the final structure will contain multiple levels of submenus.
I'm considering creating a CSS rule in my stylesheet to automatically apply margins to the menu items instead. What do you think?
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
<nav class="p-2 bg-indigo-900 text-white">
<ul class="flex flex-row">
<li class="mr-1">
<a href="#">Home</a>
</li>
<li class="ml-1 mr-1">
<a href="#">About</a>
</li>
<li class="ml-1 mr-1">
<a href="#">Services</a>
</li>
<li class="ml-1 mr-1">
<a href="#">History</a>
</li>
<li class="ml-1">
<a href="#">Contact</a>
</li>
</ul>
</nav>