# Custom sticky navigation

**URL:** <https://colorlibsupport.com/t/custom-sticky-navigation/6858>\
**Category:** Sparkling\
**Created:** [February 3, 2015, 11:24am UTC](https://colorlibsupport.com/t/custom-sticky-navigation/6858 "2015-02-03T11:24:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dstt0001](https://colorlibsupport.com/user_avatar/colorlibsupport.com/dstt0001/32/3137_2.png) [@dstt0001](https://colorlibsupport.com/u/dstt0001)\
**Post date:** [February 3, 2015, 11:24am UTC](https://colorlibsupport.com/t/custom-sticky-navigation/6858/1 "2015-02-03T11:24:32Z")

</div>

Hi  
How about keeping homepage customization only and keep a top margin for posts and pages?

I tried with the following but didn’t work:

```auto
.page .top-section,
#content {
margin-top: 50px;
}
.home .page .top-section,
#content {
margin-top: 0px;
}

```

---

<div class="post-metadata">

**Author:** ![aigars-silkalns](https://colorlibsupport.com/user_avatar/colorlibsupport.com/aigars-silkalns/32/13469_2.png) [@aigars-silkalns](https://colorlibsupport.com/u/aigars-silkalns)\
**Post date:** [February 9, 2015, 4:13pm UTC](https://colorlibsupport.com/t/custom-sticky-navigation/6858/2 "2015-02-09T16:13:54Z")

</div>

Comma in CSS means that you are separating one select from another and not combining them.

In your given example, this code:

```auto
.page .top-section,
#content {
	margin-top: 50px;
}

```

Translates as this:

```auto
.page .top-section {
	margin-top: 50px;
}
#content {
	margin-top: 50px;
}

```

But if we take out commas in your example then you won’t be targeting any element at all.
