| <!DOCTYPE html> |
| <style> |
| body { |
| height: 200%; |
| } |
| div { |
| width: 400px; |
| height: 25px; |
| background-color: silver; |
| text-align: center; |
| margin: 8px 0; |
| } |
| #absolute { |
| position: absolute; |
| width: 25px; |
| height: 25px; |
| background-color: rgba(0, 0, 255, 0.5); |
| } |
| </style> |
| <div dir="rtl"><span id="absolute"></span> Lorem ipsum dolor sit amet</span></div> |
| <div dir="ltr"><span id="absolute"></span> Lorem ipsum dolor sit amet</span></div> |
| <div><span dir="rtl"><span id="absolute"></span> Lorem ipsum dolor sit amet</span></span></div> |
| <div> <span id="absolute"></span>Lorem ipsum dolor sit amet</div> |
| <div style="text-align: left;"><span dir="rtl"><span id="absolute"></span> Lorem ipsum dolor sit amet</span></span></div> |
| <div style="text-align: right;"><span dir="rtl"><span id="absolute"></span> Lorem ipsum dolor sit amet</span></span></div> |