# How do I position the main part of my html to the right of my vertical nav bar?

**URL:** <https://forum.freecodecamp.org/t/how-do-i-position-the-main-part-of-my-html-to-the-right-of-my-vertical-nav-bar/407825>\
**Category:** General\
**Created:** [July 3, 2020, 11:41pm UTC](https://forum.freecodecamp.org/t/how-do-i-position-the-main-part-of-my-html-to-the-right-of-my-vertical-nav-bar/407825 "2020-07-03T23:41:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rthomas1726](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/rthomas1726/32/167034_2.png) [@Rthomas1726](https://forum.freecodecamp.org/u/Rthomas1726)\
**Post date:** [July 3, 2020, 11:41pm UTC](https://forum.freecodecamp.org/t/how-do-i-position-the-main-part-of-my-html-to-the-right-of-my-vertical-nav-bar/407825/1 "2020-07-03T23:41:10Z")

</div>

I am currently working on the technical documentation page. Ive built a vertical nav bar that i have positioned on the left of the page. How do i then position the main element and its children to the right of the nav bar? Also how do i get scrolling to operate separately on both sides?

---

<div class="post-metadata">

**Author:** ![landon.h.lloyd](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/landon.h.lloyd/32/187391_2.png) [@landon.h.lloyd](https://forum.freecodecamp.org/u/landon.h.lloyd)\
**Post date:** [July 4, 2020, 5:13am UTC](https://forum.freecodecamp.org/t/how-do-i-position-the-main-part-of-my-html-to-the-right-of-my-vertical-nav-bar/407825/2 "2020-07-04T05:13:35Z")

</div>

The way I did it was to set the padding for your main section a couple more pixels than your navbar, and then set your navbar position to fixed.

---

<div class="post-metadata">

**Author:** ![samolex](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/samolex/32/166737_2.png) [@samolex](https://forum.freecodecamp.org/u/samolex)\
**Post date:** [July 4, 2020, 7:47am UTC](https://forum.freecodecamp.org/t/how-do-i-position-the-main-part-of-my-html-to-the-right-of-my-vertical-nav-bar/407825/3 "2020-07-04T07:47:07Z")

</div>

> [@Rthomas1726](#):
>
> positioned on the left of the page. How do i then position the main element and its children to the right of the nav bar?

You could have shared you code.  
I don’t know what styles you have applied already, but on the navbar you could apply a position property with a value, fixed.  
On how to position the main element on the right side of the page. There are many ways. You could, use grid display (with 2 columns, such that the nav bar takes one…), flexbox…

---

<div class="post-metadata">

**Author:** ![dequilla3](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dequilla3/32/167091_2.png) [@dequilla3](https://forum.freecodecamp.org/u/dequilla3)\
**Post date:** [July 4, 2020, 9:35am UTC](https://forum.freecodecamp.org/t/how-do-i-position-the-main-part-of-my-html-to-the-right-of-my-vertical-nav-bar/407825/4 "2020-07-04T09:35:00Z")

</div>

I put margin left to center a bit my main section. You can ask me if you have a question.

```auto
.container{
	margin-left: 230px;
	transition: .3s ease-in-out;
	background: white;
	margin-top: 100px;
	padding: 50px 10px 60px 50px;
	width: 67%;
	border-top-right-radius: 50px;
	border-bottom-left-radius: 50px;
}`Preformatted text`

```

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 1, 2021, 6:47pm UTC](https://forum.freecodecamp.org/t/how-do-i-position-the-main-part-of-my-html-to-the-right-of-my-vertical-nav-bar/407825/5 "2021-06-01T18:47:46Z")

</div>

Closed on June 1, 2021, 6:47pm UTC


