Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
193
rated 0 times [  199] [ 6]  / answers: 1 / hits: 16034  / 8 Years ago, wed, july 13, 2016, 12:00:00

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.


More From » html

 Answers
14

Using CSS:



* {
direction: rtl;
}


Using JavaScript:



var children = document.children;
var i;
for (i = 0; i < children.length; i++) {
children[i].style.direction = rtl;
}


OR



document.body.style.direction = rtl;


OR ( from evolutionxbox comment )



document.body.setAttribute('dir', 'rtl')


Using JQuery (even if you are not asking about):



$(html).children().css(direction,rtl);


Inline Coding:



<body dir=rtl>


OR



<html dir=rtl>

[#61392] Monday, July 11, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
osvaldo

Total Points: 102
Total Questions: 95
Total Answers: 102

Location: Fiji
Member since Wed, Jul 14, 2021
3 Years ago
;