I want to create the curl and shadow effect as seen on w3resource’s code box:
https://www.w3resource.com/jquery-exercises/part1/jquery-practical-exercise-6.php
It’s responsive. The effect is only on the side. The middle part is shortening with the narrowing window.
There are many examples for that around but I couldn’t find a responsive version.
w3resource uses inline style. I believe an experienced person can figure it out quickly.
Question posted in PHP Versions
You can find a list of all versions here.
You can find a list of all versions here.
2
Answers
There are two box shadows you have to apply the first one is
the next in a separate class will be
To make the div responsive start with making the div
width: 100%;
. If you want to set up the entire page you need to create some sort of layout withflexbox
ofgrid
The curl effect is basically an optical illusion. There is no curl, the bottom of the ‘paper’ is a straight horizontal bottom of an element. Your eye thinks it is curling because of the shadows.
The shadows are applied using before and after pseudo elements to the ‘piece of paper’. The example you gave uses ems to size and position the shadows – you may like to play with them to get the effect you want and to make it make sense whatever size of ‘paper’ you are trying to make ‘curl’.
Here’s a simple snippet to get you started. It is responsive in that the sizes of paper and shadow are percentage values. You need to experiment to see whether using %s for the shadow makes sense or whether you are better off sticking to ems (or, actually, pxs). Also, to maintain paper aspect ratio it’s worth considering using vmin instead of %s (e.g. to keep the ratios needed for A4 or letter paper, depending on your use case).