Skip to main content

Thread: [html] Right-Justify Text


i built site multi-language support. i'm trying switch layout of page right-to-left languages , text have justified keep so. css doesn't have option right-justify text. know how can achieve this?

php code:
<?php
$lang 
getlanguage(); // function to get the browsers' preferred language
$rtol_langs = array(=> 'ar''he');
$rtol array_search($lang$rtol_langs);

$align 'left';
$justify 'justify';
if (
$rtol)
{
    
$align 'right';
    
$justify = (something to right-justify here);
}

print(
"<html lang=$lang>
<head>
<title>direction test</title>

<style type=text/css>
  .normal {text-align: 
$align}
  .justify {text-align: 
$justify}
</style>

<body>
<h3 class=normal>this is some normal text</h3>
<br>
<h3 class=justify>this is some justified text</h3>
</body>
</html>"
?>
is there better way using php or javascript? think might run problems centered text.

the code aligning right <p align="right">text</p>. try fit in needs be.


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [SOLVED] [html] Right-Justify Text


Ubuntu

Comments

Popular posts from this blog

Falang and too many redirects - Joomla! Forum - community, help and support

Infinite loop detected in JErrorInfinite loop detected in JError - Joomla! Forum - community, help and support

logged out from joomla! - Joomla! Forum - community, help and support