Working With the Language Elements in HTML5

The ruby, rt, and rp elements

 
Ruby characters are notations placed above or to the right of characters in a logographic language (such as Chinese or Japanese).
 
We use a ruby element in conjunction with the rt and rp elements, that are also new in HTML5.
 
The rt element marks the ruby notation, and the rp element denotes parentheses around an annotation that can be displayed by browsers that don’t support ruby annotations.
 
Example
  1. <html>    
  2. <head>    
  3.     <title>BDO Example</title>    
  4. </head>    
  5. <body>    
  6.     <p>    
  7.         It isleft-to-right: <bdo dir="ltr">Hello guyz</bdo>    
  8.     </p>    
  9.     <p>    
  10.         It is right-to-left: <bdo dir="rtl">Hello    
  11. guyz</bdo>    
  12.     </p>    
  13. </body>    
  14. </html>    
 

The bdo element

 
The bdo element specifies an explicit text direction for its content, overriding the automatic directionality that would usually be applied. We must use the bdo element with the dir attribute, that has the allowed values of rtl (for right-to-left layout) and ltr (for left-to-right layout).
 
Example
  1. <html>  
  2. <head>  
  3.     <title>BDO Example</title>  
  4. </head>  
  5. <body>  
  6.     <p>  
  7.         It isleft-to-right: <bdo dir="ltr">Hello guyz</bdo>  
  8.     </p>  
  9.     <p>  
  10.         It is right-to-left: <bdo dir="rtl">Hello  
  11. guyz</bdo>  
  12.     </p>  
  13. </body>  
  14. </html>
 
The bdo element specifies an explicit text direction for its content, overriding the automatic directionality that would usually be applied.