CSS - Ляв скрол бар
Ще ви покажа как да си направите скролбава да е в ляво.
Използваме своиството direction което определя насоката на текста
неговите стоиства са ltr и rtl
ltr - посоката е от лядо към дясно
rtl - посоката е от дясно към ляво

в нашия случаи искаме скрол бара да е в ляво тогава ползваме direction:rtl
ето го и CSS кода

#scroll {direction:rtl; width:300px; height:100px; overflow:auto; padding:10px; border:1px solid #ba8; margin:0 auto;}


и HTML

<div id="scroll">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>


сега вече скрол бара е в ляво но посоката на текста е в дясно , този бъг ще го оправим като в самия див със скрола добавим още един див с direction:ltr

и сега CSS

<style>
#scroll {direction:rtl; width:300px; height:100px; overflow:auto; padding:10px; border:1px solid #ba8; margin:0 auto;}
#normal{direction:ltr;}
</style>


и HTML

<div id="scroll">
<div id="normal">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
</div>


DEMO

този урок е написан специално за web-tourist.net



/ Трябва да сте регистриран за да напишете коментар /
От: batmanabg
13:25 22-07-2011
Полезен урок.
1