react-text-loop icon indicating copy to clipboard operation
react-text-loop copied to clipboard

Centering text issues?

Open Kentakoong opened this issue 4 years ago • 3 comments

I tried to set the text as center, the words isn't the same length. So it's bugging out like this :

video0

This is my code right now.

<TextLoop delay="500" fade="false">
                  <p className="text-5xl lg:text-7xl bg-gradient-to-b text-transparent bg-clip-text from-om-green-600 to-om-green-50 pb-4">Education</p>
                  <p className="text-5xl lg:text-7xl bg-gradient-to-b text-transparent bg-clip-text from-om-green-600 to-om-green-50 pb-4">Proficiency</p>
                  <p className="text-5xl lg:text-7xl bg-gradient-to-b text-transparent bg-clip-text from-om-green-600 to-om-green-50 pb-4">Ingenuity</p>
                  <p className="text-5xl lg:text-7xl bg-gradient-to-b text-transparent bg-clip-text from-om-green-600 to-om-green-50 pb-4">Competance</p>
                  <p className="text-5xl lg:text-7xl bg-gradient-to-b text-transparent bg-clip-text from-om-green-600 to-om-green-50 pb-4">Literacy</p>
                </TextLoop>

// fyi : the text center is in the top div

Hope I could get any helps, thanks!

Kentakoong avatar Aug 22 '21 13:08 Kentakoong

Also having this exact issue.

nishilshah17 avatar May 15 '22 23:05 nishilshah17

Figured it out, you need to make sure the component containing the text is the same width. So, wrap the text in a div, give it some width and center the text in the div.

nishilshah17 avatar May 16 '22 00:05 nishilshah17

Thanks!

Kentakoong avatar May 17 '22 14:05 Kentakoong