# How to align some nav items to the left and some to the right?

**URL:** <https://forum.bricksbuilder.io/t/how-to-align-some-nav-items-to-the-left-and-some-to-the-right/24950>\
**Category:** How To\
**Tags:** how-to\
**Created:** [July 30, 2024, 9:03pm UTC](https://forum.bricksbuilder.io/t/how-to-align-some-nav-items-to-the-left-and-some-to-the-right/24950 "2024-07-30T21:03:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tradidi](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/t/c57346/32.png) [@Tradidi](https://forum.bricksbuilder.io/u/Tradidi)\
**Post date:** [July 30, 2024, 9:03pm UTC](https://forum.bricksbuilder.io/t/how-to-align-some-nav-items-to-the-left-and-some-to-the-right/24950/1 "2024-07-30T21:03:20Z")

</div>

How can I align some nav items to the left and some to the far right of the nav bar?

I have already set the nav width to 100%, I have tried setting margin-left to auto for the right/last item, I have tried wrapping them in divs (which resulted in other layout issues), …

All the items are wrapped in a \<li\> tag, which I cannot reach by setting CSS on the items.

Any suggestions?

---

<div class="post-metadata">

**Author:** ![Tradidi](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/t/c57346/32.png) [@Tradidi](https://forum.bricksbuilder.io/u/Tradidi)\
**Post date:** [July 30, 2024, 9:16pm UTC](https://forum.bricksbuilder.io/t/how-to-align-some-nav-items-to-the-left-and-some-to-the-right/24950/2 "2024-07-30T21:16:00Z")

</div>

This hack works for me to align one item to the right of the nav bar:

Add an attribute to the nav item with name **parent** and value **fw** , then add this CSS:

`li:has(a[parent="fw"]) { margin-left: auto; }`

I was hoping there would be a simpler way, but at least this one works (for now).
