Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display Paragraph's text with Diagonal Indent

I wonder if there is a way to display paragraph text with diagonal indent to be some thing like that!

enter image description here

Keeping in mind that this text is written in WYSIWYG editor (Contains html tags).

I was thinking if there is a way to count the words within the paragraph excluding html tags and then making some equations to increase the indent of the text every line by jQuery or Javascript.

Is there any suggestions to do that ?

like image 505
Mohamed Amgad Avatar asked Mar 10 '11 09:03

Mohamed Amgad


1 Answers

You can skew the containing div

.holder{
  transform:skew(-40deg);
}

<div class="holder">
    <span class="rotate">Just </span>
    <span class="rotate">Like</span>
    <span class="rotate">This! </span>
</div>

and then unskew each word inside it.

.rotate {
  transform: skew(40deg);
}

https://jsfiddle.net/dcst94sv/5/

like image 166
Squirrl Avatar answered Sep 30 '22 02:09

Squirrl