Switch to full style
HTML code examples
Post a reply

change the direction of text in your page

Fri Jan 06, 2012 11:17 pm

Following show example for controlling the direction of your text in the HTML. We have applied two different ways of controlling the text direction , the first way is using dir attribute in the body tag and using value rtl or ltr ( right to left and left to right). The other way is using css. Changing the direction helps you to have many languages in your site. For example English language is ltr while Arabic language is rtl.

Code:
<html>
<
head>
  <
title>Control your text direction </title>
  <
style rel="stylesheet" type="text/css">
body {
 
  
font-familyarialverdanasans-serif;
  
font-size15px;
}

.
DirectionLTR {
  
directionltr;
}

.
DirectionRTL {
  
directionrtl;
}
</
style>
</
head>

<
body dir="rtl">
<
h1>Different direction for html part</h1>
<
div class="DirectionLTR">left to right div.</p>
<
div class="DirectionRTL">right to left div.</p>
</
body>
</
html>
 




Post a reply
  Related Posts  to : change the direction of text in your page
 overriding the direction of text within body content     -  
 Cant change the culture or UICulture of the content page     -  
 Function printing text on a Web Page     -  
 change Font of text in java     -  
 how to change the alignment text in html     -  
 Change the text indent in the paragraph     -  
 Forum Description Text color change - Need Help     -  
 Add double quotes to text dynamically, on page load     -  
 Image Scroller-scrollbar-LINE_UP,LINE_DOWN-PAGE-UP-PAGE-DOWN     -  
 Able to Copy Text from Uneditable Text Boxes(JTextfields)     -  

Topic Tags

HTML Div