How can I center text vertically?

I have a text that is connected to a data in a collection. I want the text to remain vertically centered within the element that contains it. It doesn’t matter if I have to use a textbox, a button, etc.

It should be a very simple task, but I have searched and tried several different ways, but I have not been able to do it, neither in Wix nor in Corvid. How can I do that?

1 Like

Have a read of previous posts about this.
https://www.wix.com/corvid/forum/community-discussion/center-vertically-1
https://www.wix.com/corvid/forum/community-discussion/center-vertically-2

I think you don’t understood my question, but it’s okey. These were the first ones I found, but they talk about another problem. Anyway, thank you.

@cotijaparroquia If it’s attached to a box or strip, all you have to do is select the center align icon in your Tools Toolbar. It’s right under the trash can icon.

@cotijaparroquia

I didn’t misunderstand your question, however for your purposes you are much better suited going with David’s good response and using the horizontal and vertical alignment tools from within the Wix Editor for the text box that is attached to a box for example.

Also, you can do it to multiple elements shown here.
https://support.wix.com/en/article/aligning-distributing-and-matching-the-size-of-multiple-elements

@givemeawhisky Hey guys, I was reading these topics and the links indicated: I think I understand what he is talking about because its basically my question at the momment. I have a textbox linked to a dataset, and I need the text inside the text box to be in its center vertically. Not the box aligning with the strip, but the text inside the textbox to occupy the 2d center of the textbox… like in the image #1 (sorry for my mouse sh*ty caligraph, I have trembling anxieties while posting my doubts :D)

Otherwise, when the text in the dataset is longer than the box, it expands down, like in image2

note: tested all forms of aligning the itens in that group, and even ungrouping, but the result is the same, the text expands down.

~Thanks for reading my doubts!

@lucassmdesign Keep in mind, text elements will always respect the top positioning, and only expand to the bottom. So you can make your text’s dimensions larger height-wise in the editor to give you a better idea of where you should position it. You can also try setting your text’s html property in order to have it as one single text element instead of two.

I have the same problem, the text is dynamic so this solution does not work

Hi @GOS I believe he means if you have a large text box, how do you align the text to be vertically centred…not the text box itself but the text inside the text box.

[2,5 years later] [2,1k views]
Anyone has any solution to the problem?

Any solution…?

Since the Wix editor generally uses a more fixed structure for element positioning, it’s not possible to align text vertically in this way.

I’d recommend using Wix Studio which allows you to dock elements to their parent elements in various ways, and allows for a responsive layout that supports this.

For example, aligning it’s positing to the center, so as the height of the text changes, it remains centered:
Screenshot 2024-09-11 at 14.33.27