Search code examples
htmlcssdirection

Setting a different direction for the input tag and its title attribute


I want to set the input tag in my HTML document to rtl and their title attributes to ltr. Is it possible?


Solution

  • I do not believe the direction in which the text of the tooltip is displayed in (which is what I'm guessing what you meant by their title attribute) can be dictated through CSS.

    The HTML specification simply states that browsers should display it in whatever fashion they wish, so the direction of the text in the tooltip would most likely be dependent on the user's own settings, probably at the Operating System level.

    However, you can use JavaScript to create your own, non-native tooltips, which can then be styled through CSS.