Interactive online courses HTML Academy
2026-03-09 12:26 Diff

Sometimes you need to implement shadows that differ from the standard box-shadow without using images.

For example, shadows that are skewed in various directions.

It is impossible to do this using box-shadow. Therefore, you need to use a more complex technique:

  • Let’s create two blocks with regular shadows using the before and after pseudoelements.
  • Let’s skew these blocks using rotate
  • Let’s assign them a negative z-index.

This will move the boxes with shadows under the parent container so that only parts of the shadows will face outwards.