Search code examples
csspositionalignmenttext-align

css3 rotating words align center


I have used the perfect codrops css3 rotating words according to my needs, but I can´t make the appearing words align right in the center. All I need is make the sentence align in center and so the rotating words.

But because it´s position absolute, and floating left, the word starts on left 50% position.

Can anyone help with this? I have tryied a lot of experiments but nothing seems to work.

Here is a jsfiddle: http://jsfiddle.net/nzAPr/


Solution

  • Setting the container to position:relative and the span to 100% seemed to work.

    .rw-words{
    display: block;
    position: relative;
    }
    .rw-words-1 span{
    position: absolute;
    width: 100%;
    ...
    }
    

    http://jsfiddle.net/willemvb/9Xubs/