replace rtl with ltr

  • Thread starter Thread starter Mr. X.
  • Start date Start date
M

Mr. X.

Hello,

Some of my object on the html-page, has default behaviour of : rtl
(Also in the *.css file).

I want to replace the behaviour of rtl to ltr, with minimal code.
Also the align="right".
(When browser see rtl it will reffer to ltr automatically).

Can I change the default behaviour of attribute, and swap it to something
else ?

i.e :
code in html :
<div id = "home_text" runat = "server" dir = "rtl" align = "right">

I want that HTML will act as it is written :
---------------------------------------------------
<div id = "home_text" runat = "server" dir = "ltr" align = "left">

Can I do that ?

Thanks :)
 
Hello,

Some of my object on the html-page, has default behaviour of : rtl
(Also in the *.css file).

I want to replace the behaviour of rtl to ltr, with minimal code.
Also the align="right".
(When browser see rtl it will reffer to ltr automatically).

Can I change the default behaviour of attribute, and swap it to something
else ?

i.e :
code in html :
<div id = "home_text" runat = "server" dir = "rtl" align = "right">

I want that HTML will act as it is written :
---------------------------------------------------
<div id = "home_text" runat = "server" dir = "ltr" align = "left">

Can I do that ?

Thanks :)

I think you can use different CSS-files

#home_text {
text-align: right;
direction: rtl
}

and

#home_text {
text-align: left;
direction: ltr
}
 
I know to change *.css.

The site of mine is multilangual, for right-to-left & left-to-right,
so I want the minimal *.css file, and changes.
There is not only home_text element, but many others.

(Need something like swaping the page direction, with some tricky way, for
minimal code change).

Thanks :)
 
so I want the minimal *.css file, and changes.
There is not only home_text element, but many others.

I think that you can have different *.css files and you can assign
these files automatically

Here's an example

protected void Page_Init(object sender, EventArgs e)
{
HtmlLink css = new HtmlLink();
if (language == "en") {
css.Href = "css_ltr.css";
} else {
css.Href = "css_rtl.css";
}
css.Attributes["rel"] = "stylesheet";
css.Attributes["type"] = "text/css";
css.Attributes["media"] = "all";
Page.Header.Controls.Add(css);
}

Hope this helps
 
Back
Top