angularright-to-leftngx-translateleft-to-right

Change css on Multi language website


I made a double language website using angular 4 and ngx-translate. one rtl and the other one ltr. How can I change the direction of text and text alignment on language change?

I cant use because I don't know how to change this attribute in angular.

html:lang(en) h1{
    text-align: left;
}

Any way I can target each language in style.css??


Solution

  • What you need to modify in order to convert a left-to-right stylesheet to a right-to-left one:

    After that, take a look at the page, and see if you need any additional minor modifications like box-shadow, text-shadow, etc.

    CSSJanus

    You can use CSSJanus to do the second and third steps above for you. However, you will need to do the <html> step yourself.

    For more information

    Visit this page from W3C, which answers the question:

    How should I use the dir attribute and related markup to set text direction on structural elements in HTML?