# Sorry I posted already but it’s gone awol, can you help me source correct code for centering a div?

**URL:** <https://forums.realmacsoftware.com/t/sorry-i-posted-already-but-it-s-gone-awol-can-you-help-me-source-correct-code-for-centering-a-div/936>\
**Category:** RapidWeaver Classic\
**Created:** [July 30, 2015, 7:15pm UTC](https://forums.realmacsoftware.com/t/sorry-i-posted-already-but-it-s-gone-awol-can-you-help-me-source-correct-code-for-centering-a-div/936 "2015-07-30T19:15:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gabrielle](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/gabrielle/32/183_2.png) [@Gabrielle](https://forums.realmacsoftware.com/u/Gabrielle)\
**Post date:** [July 30, 2015, 7:15pm UTC](https://forums.realmacsoftware.com/t/sorry-i-posted-already-but-it-s-gone-awol-can-you-help-me-source-correct-code-for-centering-a-div/936/1 "2015-07-30T19:15:47Z")

</div>

My site is here: [Discography](http://www.wesmcghee.com/discography/)  
At the bottom of the page I’m using a smooth scroller stack by Maik Barz and the code looks like this:

back to top
 Ack it's removed the code, ok I'm attaching a screen grab. ![](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/1X/322b9c44f4476140d3c38b88528c391fad77315c.jpg)

But how can I center the text? Do I do it within this div code or put it in the css pane and what would the code look like?

---

<div class="post-metadata">

**Author:** ![blueballdesign](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/blueballdesign/32/140_2.png) [@blueballdesign](https://forums.realmacsoftware.com/u/blueballdesign)\
**Post date:** [July 30, 2015, 7:34pm UTC](https://forums.realmacsoftware.com/t/sorry-i-posted-already-but-it-s-gone-awol-can-you-help-me-source-correct-code-for-centering-a-div/936/2 "2015-07-30T19:34:04Z")

</div>

Hi Gabrielle,

To center the Back To Top text try adding this bit of css code into the Page Inspector custom css window:

.smooth\_scroll {text-align:center;}

That seemed to work when I just did a quick test on your site page for that text in the stack. Let me know your results please.

Best,  
Charlie

---

<div class="post-metadata">

**Author:** ![becca\_shillito](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/becca_shillito/32/141_2.png) [@becca\_shillito](https://forums.realmacsoftware.com/u/becca_shillito)\
**Post date:** [July 30, 2015, 7:34pm UTC](https://forums.realmacsoftware.com/t/sorry-i-posted-already-but-it-s-gone-awol-can-you-help-me-source-correct-code-for-centering-a-div/936/3 "2015-07-30T19:34:05Z")

</div>

What text would you like?

The text goes between the two \>\< where the \*\* are below: So you can put anything you like here.

```
[code]<div id="backtotop"> **back to top** </div>[/code]

```

I haven’t used that stack before so sorry if I got the wrong end of the stick…!

---

<div class="post-metadata">

**Author:** ![becca\_shillito](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/becca_shillito/32/141_2.png) [@becca\_shillito](https://forums.realmacsoftware.com/u/becca_shillito)\
**Post date:** [July 30, 2015, 7:48pm UTC](https://forums.realmacsoftware.com/t/sorry-i-posted-already-but-it-s-gone-awol-can-you-help-me-source-correct-code-for-centering-a-div/936/4 "2015-07-30T19:48:02Z")

</div>

oh my eyes… just seen that you wrote center not enter, clearly I’m not wearing my glasses enough!!!

---

<div class="post-metadata">

**Author:** ![Gabrielle](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/gabrielle/32/183_2.png) [@Gabrielle](https://forums.realmacsoftware.com/u/Gabrielle)\
**Post date:** [July 31, 2015, 11:32am UTC](https://forums.realmacsoftware.com/t/sorry-i-posted-already-but-it-s-gone-awol-can-you-help-me-source-correct-code-for-centering-a-div/936/5 "2015-07-31T11:32:36Z")

</div>

Works perfectly Charlie you star ;-))  
Thanks Becca for responding, it’s all appreciated ;-).
