# Centered text shifts down a line or so?

**URL:** <https://forums.realmacsoftware.com/t/centered-text-shifts-down-a-line-or-so/32969>\
**Category:** RapidWeaver Classic\
**Created:** [May 18, 2020, 7:50pm UTC](https://forums.realmacsoftware.com/t/centered-text-shifts-down-a-line-or-so/32969 "2020-05-18T19:50:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruce](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bruce/32/23155_2.png) [@bruce](https://forums.realmacsoftware.com/u/bruce)\
**Post date:** [May 18, 2020, 7:50pm UTC](https://forums.realmacsoftware.com/t/centered-text-shifts-down-a-line-or-so/32969/1 "2020-05-18T19:50:40Z")

</div>

Is there a way to stop centered text from shifting down? Look at the Tipp City text in both screen shots please:

 ![19%20PM](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/4/d/4d9fffc8def0a1a9acbba97c4c25defff824701b.png) ![50%20PM](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/3/2/3223abf4a73dbd2f39ea119825c9b43163d3cb8e.png)

---

<div class="post-metadata">

**Author:** ![teefers](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/teefers/32/8173_2.png) [@teefers](https://forums.realmacsoftware.com/u/teefers)\
**Post date:** [May 18, 2020, 8:08pm UTC](https://forums.realmacsoftware.com/t/centered-text-shifts-down-a-line-or-so/32969/2 "2020-05-18T20:08:50Z")

</div>

I think we’ll need to know how you are centering? Is this in a stack? Maybe a URL?

---

<div class="post-metadata">

**Author:** ![bruce](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bruce/32/23155_2.png) [@bruce](https://forums.realmacsoftware.com/u/bruce)\
**Post date:** [May 18, 2020, 9:42pm UTC](https://forums.realmacsoftware.com/t/centered-text-shifts-down-a-line-or-so/32969/3 "2020-05-18T21:42:31Z")

</div>

In the text stack. Page is not published yet.

 ![43%20PM](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/c/4/c49489be03eaf764c0b70911319964a620a7108e.png)

---

<div class="post-metadata">

**Author:** ![DLH](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@DLH](https://forums.realmacsoftware.com/u/DLH)\
**Post date:** [May 18, 2020, 10:00pm UTC](https://forums.realmacsoftware.com/t/centered-text-shifts-down-a-line-or-so/32969/4 "2020-05-18T22:00:06Z")

</div>

When you center the text, the styled text engine used by the text stack wraps the text in a paragraph tag `<p>` to do the centering. Prior to centering it, it is not in a `<p>` tag.

My guess is that your theme’s CSS has a top margin that gets applied to paragraphs. Without an url to see exactly what’s going on it’s hard to say for sure. We’d be guessing and any CSS we suggest could affect spacing on text elsewhere on the page.

If you can publish a test copy of the page and provide that url, we’d be able to help.

Duplicate the page using folder name you haven’t used on your site. Something like “testpage” would likely work. Under that page’s General Setting, uncheck “Show in navigation”. On the Meta Tags properties, Leave “Enable Robot Meta Tags” checked and uncheck “Index this page” and “Follow links”.

---

<div class="post-metadata">

**Author:** ![bruce](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bruce/32/23155_2.png) [@bruce](https://forums.realmacsoftware.com/u/bruce)\
**Post date:** [May 18, 2020, 10:41pm UTC](https://forums.realmacsoftware.com/t/centered-text-shifts-down-a-line-or-so/32969/5 "2020-05-18T22:41:31Z")

</div>

Here’s the link to the test page. Very little is complete. The only question I have is about the centered Tipp City text.  
[https://www.kitchyglass.com/page-4/](https://www.kitchyglass.com/page-4/)

---

<div class="post-metadata">

**Author:** ![DLH](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@DLH](https://forums.realmacsoftware.com/u/DLH)\
**Post date:** [May 18, 2020, 11:22pm UTC](https://forums.realmacsoftware.com/t/centered-text-shifts-down-a-line-or-so/32969/6 "2020-05-18T23:22:24Z")

</div>

The theme leaves the browser default margin on paragraph tags `<p>`. By default, they have 1em of top and bottom margin. What you’re seeing is the addition of that additional margin when you center it, because it’s now in a `<p>` tag. Here are two options.

Remove the top margin on `<p>` tags. This could affect other spacing in the theme.

```
p {
    margin-top: 0;
}

```

Since you are using Stacks 4, instead of using the “center” text formatting feature, add a CSS class to the text stack to center the text. In the text stack’s settings, add a class of “center-text” and paste the following CSS in the site-wide CSS area.

```
.center-text {
	text-align: center;
}
```

---

<div class="post-metadata">

**Author:** ![bruce](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bruce/32/23155_2.png) [@bruce](https://forums.realmacsoftware.com/u/bruce)\
**Post date:** [May 19, 2020, 1:45am UTC](https://forums.realmacsoftware.com/t/centered-text-shifts-down-a-line-or-so/32969/7 "2020-05-19T01:45:07Z")

</div>

The second method works great. I tried something else that which shows the text centered in both RW preview and edit. I added a Header X stack. Is there any reason why using a header stack here is a bad idea? My page is updated if you want to take a look.

 ![17%20PM](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/7/5/75a094c01c25e25b8973ed1a4f7f37b55ffdd27d.jpeg)

---

<div class="post-metadata">

**Author:** ![DLH](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@DLH](https://forums.realmacsoftware.com/u/DLH)\
**Post date:** [May 19, 2020, 2:32am UTC](https://forums.realmacsoftware.com/t/centered-text-shifts-down-a-line-or-so/32969/8 "2020-05-19T02:32:44Z")

</div>

I’m not familiar with that header stack, but it looks like a typical header stack with responsive alignment options.

There’s nothing wrong with using a header for that content. From an SEO standpoint, it’s probably better than leaving it in a regular text stack. That text is basically the title of the item being offered, and as such, it’s more important than just a regular paragraph of text.

---

<div class="post-metadata">

**Author:** ![bruce](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bruce/32/23155_2.png) [@bruce](https://forums.realmacsoftware.com/u/bruce)\
**Post date:** [May 19, 2020, 11:16am UTC](https://forums.realmacsoftware.com/t/centered-text-shifts-down-a-line-or-so/32969/9 "2020-05-19T11:16:43Z")

</div>

Don, Thanks for your help with this. You taught me how to center text with Stacks 4, and I will use that in the future.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/system/32/25301_2.png) [@system](https://forums.realmacsoftware.com/u/system)\
**Post date:** [June 18, 2020, 9:16pm UTC](https://forums.realmacsoftware.com/t/centered-text-shifts-down-a-line-or-so/32969/10 "2020-06-18T21:16:45Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
