replace rtl with ltr

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 :)
 
G

Guest

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
}
 
M

Mr. X.

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 :)
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top