2016-04-18 5 views
0

Ich versuche, den Text in Webview Android (für eine Sprache von rechts nach links) innerhalb der div-Tag zu rechtfertigen, aber der Text wird nicht gerecht zu rechtfertigen ! Auch die letzte Zeile ist nicht richtig ausgerichtet! Ich habe unten Code verwendet, aber nicht funktioniert. http://jsfiddle.net/XkQrF/112/text-align justify und letzte Zeile right-alignment funktioniert nicht von rechts nach links Sprache

div { 
    display:inline ; 
    direction: rtl; 
    text-align:justify; 
    word-wrap:break-word; 
    white-space:normal; 
    text-align-last: right; -ms-text-align-last:right; 
    } 

Alse, sollte ich anmerken, dass ich inline verwendet haben, weil ich nebeneinander platzieren divs wollen. Danke für jede Hilfe.

+0

Funktioniert gut ohne das 'display: inline' ... https://jsfiddle.net/MrLister/4jw2kdoa/ Also, wie wäre es mit' display: inline-block'? –

+0

Danke @Mr Lister. Aber ohne display: inline kann ich divs nicht nebeneinander platzieren. Siehe den Link:

+0

OK, siehe meine Antwort. Aber was ist mit all den "linken" und "oberen" Eigenschaften? Die divs sind nicht positioniert, also tun diese Eigenschaften nichts. –

Antwort

1

Das Problem ist, dass Inline-Elemente text-align überhaupt nicht tun, noch text-align-last. Dies hat nichts mit der Direktionalität des Textes zu tun.

Eine Lösung wäre, alle Divs in einen Container zu legen und dem Container die Ausrichtungseigenschaften zu geben.

.container { 
 
    direction: rtl; 
 
    text-align: justify; 
 
    text-align-last: right; -ms-text-align-last: right; 
 
} 
 

 
div { 
 
    display: inline; 
 
    word-wrap: break-word; 
 
    white-space: normal; 
 
}
<section class="container"> 
 
    <div style="left:118.67px;top:422.67px"> 
 
    <img alt='img' src='images\Java_GraphicFillImg_1.png' width="554.67px" height="1.33px" /> 
 
    </div> 
 
    <div style="left:118.67px;top:502.67px"> 
 
    <img alt='img' src='images\Java_GraphicFillImg_2.png' width="554.67px" height="1.33px" /> 
 
    </div> 
 
    <div style="left:489.33px;top:556.00px"> 
 
    <img alt='img' src='images\Java_GraphicFillImg_3.png' width="184.00px" height="1.33px" /> 
 
    </div> 
 
    <div style="left:434.399900pt;top:116.555700pt;FONT-SIZE:12.000000pt; COLOR:RGB(255,0,0);font-family:Times New Roman">‫اﺻﻞ و ﻧﺴﺐ ﺟﺎوا‬</div> 
 

 
    <div style="left:89.999900pt;top:159.839700pt;FONT-SIZE:12.000000pt;font-family:Times New Roman">‫ﺟﺎوا ﺑﻪ زﺑﺎن ++‪ C‬ﻧﺘﯿﺠﻪ ﻣﺴﺘﻘﯿﻢ زﺑﺎن ‪ C‬واﺑﺴﺘﻪ اﺳـﺖ . ﺑﺴـﯿﺎری از ﺧﺼـﻠﺘﻬﺎی ﺟـﺎوا ﺑﻄـﻮر ﻣﺴـﺘﻘﯿﻢ از اﯾـﻦ دو زﺑـﺎن‬</div> 
 

 
    <div style="left:93.845900pt;top:179.939700pt;FONT-SIZE:12.000000pt;font-family:Tahoma">‫ﮔﺮﻓﺘﻪ ﺷﺪه اﺳﺖ . دﺳﺘﻮر زﺑﺎن ﺟﺎوا ﻣﻨﺘﺞ از دﺳﺘﻮر زﺑﺎن ‪ C‬اﺳﺖ . ﺑﺴـﯿﺎری از ﺟﻨﺒـﻪ ﻫـﺎی ‪ oop‬زﺑـﺎن ﺟـﺎوا از ++‪C‬‬</div> 
 

 
    <div style="left:89.996300pt;top:204.863700pt;FONT-SIZE:12.000000pt;font-family:Times New Roman">‫ﺑﻌﺎرﯾﺖ ﮔﺮﻓﺘﻪ ﺷﺪه اﺳﺖ . در ﺣﻘﯿﻘﺖ ﺑﺴﯿﺎری از ﺧﺼﻠﺘﻬﺎی زﺑﺎن ﺟﺎوا از اﯾﻦ دو زﺑﺎن ﻣﺸﺘﻖ ﺷﺪه ﯾﺎ ﺑﺎ آﻧﻬﺎ ﻣـﺮﺗﺒﻂ اﺳـﺖ .‬</div> 
 

 
    <div style="left:89.999900pt;top:224.843700pt;FONT-SIZE:12.000000pt;font-family:Times New Roman">‫ﻋﻼوه ﺑﺮ اﯾﻦ ، ﺗﻮﻟﯿﺪ ﺟﺎوا ﺑﻄﻮر ﻋﻤﯿﻘﯽ ﻣﺘﺎﺛﺮ از روال ﭘﺎﻻﯾﺶ و ﺗﻄﺒﯿﻘﯽ اﺳﺖ ﮐﻪ ﻃﯽ ﺳﻪ دﻫﻪ ﮔﺬﺷﺘﻪ ﺑﺮای زﺑﺎﻧﻬـﺎی ﺑﺮﻧﺎﻣـﻪ‬</div> 
 

 
    <div style="left:93.959900pt;top:240.059700pt;FONT-SIZE:12.000000pt;font-family:Times New Roman">‫ﻧﻮﯾﺴﯽ ﻣﻮﺟﻮد ﭘﯿﺶ آﻣﺪه اﺳﺖ . ﺑﻬﻤﯿﻦ دﻻﯾﻞ ﺑﻬﺘﺮ اﺳﺖ ﺳﯿﺮ ﻣﺮاﺣﻞ و ﻧﯿﺮوﻫﺎﯾﯽ ﮐﻪ ﻣﻨﺠﺮ ﺑﻪ ﺗﻮﻟﺪ ﺟﺎوا ﺷﺪه را ﺑﺮرﺳـﯽ‬</div> 
 

 
    <div style="left:89.999900pt;top:264.983700pt;FONT-SIZE:12.000000pt;font-family:Times New Roman">‫ﻧﻤﺎﯾﯿﻢ . ﻫﺮﻧﻮع اﺑﺘﮑﺎر و ﻓﮑﺮ ﺟﺪﯾﺪ در ﻃﺮاﺣﯽ زﺑﺎﻧﻬﺎ ﺑﺮاﺳﺎس ﻧﯿﺎز ﺑﻪ ﭘﺸﺖ ﺳﺮ ﻧﻬﺎدن ﯾﮏ ﻣﺸﮑﻞ اﺻﻠﯽ اﺳﺖ ﮐـﻪ زﺑﺎﻧﻬـﺎی‬</div> 
 

 
    <div style="left:274.925900pt;top:280.199700pt;FONT-SIZE:12.000000pt;font-family:Tahoma">‫ﻗﺒﻠﯽ از ﺣﻞ آن ﻋﺎﺟﺰ ﻣﺎﻧﺪه اﻧﺪ . ﺟﺎوا ﻧﯿﺰ ﺑﻬﻤﯿﻦ ﺗﺮﺗﯿﺐ ﻣﺘﻮﻟﺪ ﺷﺪ .‬</div> 
 

 
    <div style="left:89.999900pt;top:300.359700pt;FONT-SIZE:12.000000pt; COLOR:RGB(0,0,128);font-family:Times New Roman">‫ﺟﺎوا از ﻧﻈﺮ ﺳﺎﺧﺘﺎر ﺑﺴﯿﺎر ﺷﺒﯿﻪ زﺑﺎن ++‪ C/C‬و اﯾﻦ ﺑﻪ ﻫﯿﭻ وﺟﻪ ﺗﺼﺎدﻓﯽ ﻧﯿﺴﺖ ‪ c‬زﺑﺎﻧﯽ اﺳﺖ ﺳﺎﺧﺘﻪ ﯾﺎﻓﺘـﻪ و ++‪ c‬زﺑـﺎﻧﯽ‬</div> 
 

 
    <div style="left:90.000000pt;top:320.459700pt;FONT-SIZE:12.000000pt; COLOR:RGB(0,0,128);font-family:Times New Roman">‫ﺷﯽ ﮔﺮا و ﻣﻬﻤﺘﺮ از ﻫﻤﻪ ﻗﺴﻤﺖ اﻋﻈﻢ ﺑﺮﻧﺎﻣﻪ ﻧﻮﯾﺴﺎن دﻧﯿﺎ از ++‪ C/C‬اﺳﺘﻔﺎده ﻣﯽ ﮐﻨﻨـﺪ. و از ﺳـﻮی دﯾﮕـﺮ اﯾـﻦ ﺣﺮﮐـﺖ ﺑـﻪ‬</div> 
 

 
    <div style="left:327.420000pt;top:345.383700pt;FONT-SIZE:12.000000pt; COLOR:RGB(0,0,128);font-family:Times New Roman">‫ﻃﺮف ﺟﺎوا را ﺑﺮای اﯾﻦ ﻗﺒﯿﻞ اﻓﺮاد ﺳﺎده ﺧﻮاﻫﺪ ﮐﺮد.‬</div> 
 

 
    <div style="left:90.000000pt;top:360.599700pt;FONT-SIZE:12.000000pt; COLOR:RGB(0,0,128);font-family:Times New Roman">‫ﺟﺎوا ﺑﺎ دور اﻧﺪاﺧﺘﻦ ﻧﺸﺎﻧﮕﺮﻫﺎ)‪(Pointers‬و ﺑﺮ دوش ﮐﺸﯿﺪن ﺑﺎر ﻣﺪﯾﺮﯾﺖ ﺣﺎﻓﻈـﻪ ﺑﺮﻧﺎﻣـﻪ ﻧﻮﯾﺴـﺎن ++‪ C/C‬را ﺑـﺮای‬</div> 
 

 
    <div style="left:90.000000pt;top:380.759700pt;FONT-SIZE:12.000000pt; COLOR:RGB(0,0,128);font-family:Times New Roman">‫ﻫﻤﯿﺸﻪ از اﯾﻦ ﮐﺎﺑﻮس رﻫﺎﯾﯽ ﺑﺨﺸﯿﺪه اﺳﺖ ﺟﺎوا ﻫﻤﭽﻮن ++‪ C/C‬ﺑﻪ ﺑﺰرﮔﯽ و ﮐﻮﭼﮑﯽ ﺣـﺮوف ﺣﺴـﺎس اﺳـﺖ و ﺑﺮﻧﺎﻣـﻪ‬</div> 
 

 
    <div style="left:367.980000pt;top:400.859700pt;FONT-SIZE:12.000000pt; COLOR:RGB(0,0,128);font-family:Times New Roman">‫ﻧﻮﺷﺘﻪ ﺷﺪه ﺑﺎﯾﺪ دارای ﻣﺘﺪ ‪ main‬ﺑﺎﺷﺪ.‬</div> 
 

 
    <div style="left:406.080000pt;top:460.115700pt;FONT-SIZE:12.000000pt; COLOR:RGB(255,0,0);font-family:Times New Roman">‫زﻣﯿﻨﻪ ﻫﺎی ﭘﯿﺪاﯾﺶ ﺟﺎوا‬</div> 
 

 
    <div style="left:90.000000pt;top:488.939700pt;FONT-SIZE:12.000000pt;font-family:Times New Roman">‫ﺗﺎرﯾﺨﭽﻪ زﺑﺎﻧﻬﺎی ﺑﺮﻧﺎﻣﻪ ﻧﻮﯾﺴﯽ ﺑﺸﺮح زﯾﺮ اﺳﺖ : زﺑﺎن ‪ B‬ﻣﻨﺠﺮ ﺑـﻪ ﻇﻬـﻮر زﺑـﺎن ‪ C‬و‪ C‬زﻣﯿﻨـﻪ ﭘﯿـﺪاﯾﺶ ++‪ C‬ﺷـﺪ و در‬</div> 
 

 
    <div style="left:90.000000pt;top:509.039700pt;FONT-SIZE:12.000000pt;font-family:Times New Roman">‫ﻧﻬﺎﯾﺖ زﺑﺎن ﺟﺎوا ﻣﺘﻮﻟﺪ ﺷﺪ . درک زﺑﺎن ﺟﺎوا ﻣﺴﺘﻠﺰم : درک زﻣﯿﻨﻪ ﻫﺎی ﻻزم ﺑﺮای اﯾﺠﺎد ﺟﺎوا ، ﻧﯿﺮوﻫﺎﯾﯽ ﮐﻪ اﯾﻦ زﺑـﺎن‬</div> 
 

 
    <div style="left:90.000000pt;top:529.199700pt;FONT-SIZE:12.000000pt;font-family:Times New Roman">‫را ﺷﮑﻞ داده اﻧﺪ و ﻣﺸﺨﺼﺎﺗﯽ اﺳﺖ ﮐﻪ اﯾﻦ زﺑﺎن از اﺳﻼف ﺧﻮد ﺑﻪ ارث ﺑﺮده اﺳﺖ . ﻧﻈﯿﺮ ﺳـﺎﯾﺮ زﺑﺎﻧﻬـﺎی ﺑﺮﻧﺎﻣـﻪ ﻧﻮﯾﺴـﯽ‬</div> 
 

 
    <div style="left:90.000000pt;top:554.123700pt;FONT-SIZE:12.000000pt;font-family:Times New Roman">‫ﻣﻮﻓﻖ ، ﺟﺎوا ﻧﯿﺰ ﻋﻨﺎﺻﺮ ﺑﺎرث ﺑﺮده از اﺳﻼف ﺧﻮد را ﺑﺎ اﯾﺪه ﻫﺎی اﺑﺘﮑﺎری ﮐﻪ ﻧﺎﺷﯽ از ﻣﺤﯿﻂ ﻣﻨﺤﺼﺮ ﺑﻔﺮد اﯾﻦ زﺑـﺎن ﺑـﻮده‬</div> 
 

 
    <div style="left:94.200000pt;top:569.339700pt;FONT-SIZE:12.000000pt;font-family:Times New Roman">‫درﻫﻢ آﻣﯿﺨﺘـﻪ اﺳـﺖ . ﻓﺼـﻮل ﺑﻌـﺪی ﺟﻨﺒـﻪ ﻫـﺎی ﻋﻤﻠـﯽ زﺑـﺎن ﺟـﺎوا ﺷـﺎﻣﻞ دﺳـﺘﻮر زﺑـﺎن)‪ (syntax‬و ﮐﺘﺎﺑﺨﺎﻧـﻪ ﻫـﺎ‬</div> 
 

 
    <div style="left:90.000000pt;top:589.439700pt;FONT-SIZE:12.000000pt;font-family:Times New Roman">‫)‪(libraries‬و ﮐﺎرﺑﺮدﻫﺎی ﺟﺎوا را ﺗﻮﺻﯿﻒ ﻣﯽ ﮐﻨﺪ . ﻓﻌﻼ" ﭼﮕﻮﻧﮕﯽ و ﻋﻠﺖ ﻇﻬﻮر ﺟﺎوا و اﻫﻤﯿﺖ آن را ﺑﺮرﺳﯽ ﻣـﯽ‬</div> 
 

 
    <div style="left:90.000000pt;top:609.599700pt;FONT-SIZE:12.000000pt;font-family:Times New Roman">‫ﮐﻨﯿﻢ . اﮔﺮ ﭼﻪ ﺟﺎوا ﺗﻔﮑﯿﮏ ﻧﺎﭘﺬﯾﺮی ﺑﺎ ﻣﺤﯿﻂ ﻫﺎی ﻫﻤﺰﻣﺎن اﯾﻨﺘﺮﻧﺖ ﭘﯿﻮﺳﺘﮕﯽ دارد ، اﻣﺎ ﺑﺨﺎﻃﺮ ﺑﺴﭙﺎرﯾﺪ ﮐﻪ ﺟﺎوا ﻗﺒـﻞ از‬</div> 
 

 
    <div style="left:90.000000pt;top:634.523700pt;FONT-SIZE:12.000000pt;font-family:Times New Roman">‫ﻫﺮ ﭼﯿﺰ ﯾﮏ زﺑﺎن ﺑﺮﻧﺎﻣﻪ ﻧﻮﯾﺴﯽ اﺳﺖ . اﺑﺪاﻋﺎت و ﭘﯿﺸﺮﻓﺖ ﻫﺎ در زﺑﺎﻧﻬـﺎی ﺑﺮﻧﺎﻣـﻪ ﻧﻮﯾﺴـﯽ ﮐـﺎﻣﭙﯿﻮﺗﺮ ﺑـﺪو دﻟﯿـﻞ ﺑـﺮوز ﻣـﯽ‬</div> 
 

 
    <div style="left:90.000000pt;top:649.739700pt;FONT-SIZE:12.000000pt;font-family:Times New Roman">‫ﮐﻨﻨﺪ : ﺗﻄﺎﺑﻖ ﺑﺎ ﺗﻐﯿﯿﺮات ﻣﺤﯿﻂ ﻫﺎ و ﮐﺎرﺑﺮدﻫﺎ . اﯾﺠﺎد ﭘﺎﻻﯾﺶ و ﭘﯿﺸـﺮﻓﺖ در ﻫﻨـﺮ ﺑﺮﻧﺎﻣـﻪ ﻧﻮﯾﺴـﯽ . ﻫﻤﺎﻧﻄﻮرﯾﮑـﻪ ﺑﻌـﺪا"‬</div> 
 

 
    <div style="left:237.540000pt;top:674.603700pt;FONT-SIZE:12.000000pt;font-family:Times New Roman">‫ﻣﺸﺎﻫﺪه ﻣﯽ ﮐﻨﯿﺪ ، ﺗﻮﻟﺪ ﺟﺎوا از اﯾﻦ دو دﻟﯿﻞ ﺑﻄﻮر ﯾﮑﺴﺎن ﺑﻪ ارث ﮔﺮﻓﺘﻪ اﺳﺖ.‬</div> 
 

 
    <div style="left:90.000000pt;top:694.583700pt;FONT-SIZE:12.000000pt;font-family:Times New Roman">‫ﺟﺎوا ﻫﻢ ﻣﺎﻧﻨﺪ اﮐﺜﺮ اﺧﺘﺮاﻋﺎت ﻣﻬﻢ ﺣﺎﺻﻞ ﺗﻼش ﮔﺮوﻫﯽ داﻧﺸﻤﻨﺪ ﭘﯿﺸﺘﺎز اﺳﺖ . ﻣﺪﯾﺮان ﺳﺎن ﺑﻪ اﯾﻦ ﻓﮑﺮ اﻓﺘﺎدﻧﺪ ﮐﻪ ﮐـﺎری‬</div> 
 

 
    <div style="left:90.000000pt;top:709.859700pt;FONT-SIZE:12.000000pt;font-family:Times New Roman">‫ﮐﻨﻨﺪ ﮐﻪ ﺳﯿﺴﺘﻢ ﻣﺰﺑﻮر ﺑﺘﻮاﻧﺪ ﺑﻪ ﺳﯿﺴﺘﻢ ﺳﺨﺖ اﻓﺰاری ﻣﺨﺘﻠﻒ ﻣﻨﺘﻘﻞ ﺷﻮد . ﺑﺮای اﯾﻦ ﻣﻨﻈﻮر اﺑﺘﺪا از ﮐﺎﻣﭙﺎﯾﻠﺮ ++‪ c‬اﺳﺘﻔﺎده‬</div> 
 

 
</section>

By the way, warum verwenden Sie divs für die Inline-Textstücke? Ich sehe keinen Grund, keine Spannweiten dort zu verwenden. Divs sollen Blöcke sein! (Tut mir leid, mein Liebling.)

+0

Vielen Dank @Mr Lister. Es scheint, dass alles OKKKK ist !!!! Die Verwendung von Spannen ist wirklich besser. Mein HTML-Code wird von einer Konverter-App ausgegeben, die geändert werden muss. –

Verwandte Themen