Arabic HTML layout direction with css

后端 未结 4 1404
长发绾君心
长发绾君心 2021-01-03 10:38

To change the text direction to right to left it is known that we the following CSS code:

direction:rtl; //displays text direction as right to left


        
相关标签:
4条回答
  • 2021-01-03 11:02

    Add dir="rtl" to the html tag any time the overall document direction is right-to-left. This sets the base direction for the whole document.

    <!DOCTYPE html>
    <html dir="rtl" lang="ar">
    <head>
    
    0 讨论(0)
  • 2021-01-03 11:12

    Your best bet is likely to use a CSS processor tool similar to Google's CSS Janus; this type of tool does several things to flip a site's CSS from left-to-right oriented to right-to-left oriented, including adding direction:rtl, but also flipping left/right position and size values - so, for example, a DIV placed 4px from the left edge of its parent ends up instead being placed 4px from the right.

    This means you'll end up with two stylesheets for your site: the original one, to use in left-to-right version, and a processed version to use in the right-to-left version.

    0 讨论(0)
  • 2021-01-03 11:13

    This wil RTL everything in the page:

    body {
      margin: 50px;
      direction: rtl;
    }
    <p>معادن</p>
    <ol>
      <li>ذهب</li>
      <li>فضة</li>
      <li>حديد</li>
    </ol>

    0 讨论(0)
  • 2021-01-03 11:16

    you can try

    body 
    {direction:rtl;}

    0 讨论(0)
提交回复
热议问题