I need to flip vertically all the letter at even positions while keeping the letters at the odd positions intact in element. Now I'm using this css style: -webkit-transform: rotateX(180deg). But it flips the whole text in input element.
What should I do else? Or maybe it's possible in another element, not an input?
At this time, there is no way to select the letters within an element (or within the value of an element). Theoretically, a
:nth-letter()
pseudo-element would do the trick, but this doesn't exist.You can however use JavaScript to take the value of the input, explode the string by character, wrap
span
elements around each character, put these elements into some other container, and do the transformation onspan:nth-of-type(even)
.CSS
JavaScript
I've made a jsFiddle to demonstrate this.