方向rtl到所有页面 [英] Direction rtl to all page
本文介绍了方向rtl到所有页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的HTML页面很长.
我想将所有文本/表格的方向更改为rtl.
我该如何对所有页面执行此操作,而不是将rtl的方向更改为任何元素?
谢谢.
I have a long html page.
I want to change the direction of all text/tables to rtl.
How can i do that to all page instead of to change to any element the direction to rtl?
Thanks.
推荐答案
使用CSS:
* {
direction: rtl;
}
使用JavaScript:
var children = document.children;
var i;
for (i = 0; i < children.length; i++) {
children[i].style.direction = "rtl";
}
或
document.body.style.direction = "rtl";
OR(来自 evolutionxbox
注释)
document.body.setAttribute('dir', 'rtl')
使用JQuery (即使您不询问):
$("html").children().css("direction","rtl");
内联编码:
<body dir="rtl">
OR
<html dir="rtl">
这篇关于方向rtl到所有页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文