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

∥☆過路亽.° 提交于 2019-12-12 17:24:49

问题


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


回答1:


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.




回答2:


I can't think of a css selector that would allow you to access the title attribute, so no; I really don't think this is possible. I'll also note that having two different text-flow directions in the same document, and, potentially, differing between one element and its tooltip would likely be confusing.

This would be possible with JavaScript, though.



来源:https://stackoverflow.com/questions/4692914/setting-a-different-direction-for-the-input-tag-and-its-title-attribute

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!