Without using pseudo-element
- Add
transform: skewX
property to stretch the element on the
X axis.
- Problem !! Using this method involved that all childs elements will be
stretch too.
Using pseudo-element
- We first add
position: relative
to the element parent.
- We create our
::before
element in our CSS file.
- Now, you can start to stylized your
::before
element.
- Once your pseudo-element is correctly stylized you can simply add
transform: skew
on him to stretch only this element.