How to create pages similar to a book shadows, using two divs and CSS3? Equal in the image that follows attachment.
I tried using box-shadow with inset but it worked.
box-shadow: inset -5px -5px 5px #888;
Thank you.
Shadow page
asked Jan 28, 2014 at 13:51
Guttemberg
4211 gold badge6 silver badges20 bronze badges
-
« I tried using box-shadow with inset but it worked. » — I suppose you mean but it didn't work — but what were the results?Barney– Barney2014年01月28日 14:19:51 +00:00Commented Jan 28, 2014 at 14:19
2 Answers 2
You can use linear gradient:
.leftPage{
background: linear-gradient(to right, #fff 92%, #9f9f9f 100%);
}
.rightPage{
background: linear-gradient(to left, #fff 95%, #898989 100%);
}
example -> jsfiddle
answered Jan 29, 2014 at 12:20
Damian Krawczyk
2,2411 gold badge18 silver badges26 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
Here you go http://jsfiddle.net/DhgY8/1/
HTML
<div class="book">
<div class="left page"></div>
<div class="right page"></div>
</div>
CSS
.book {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: silver;
}
.left {
box-shadow: 6px 0 2px 1px black, -8px 0 6px grey inset;
z-index: 3;
left: 0;
}
.right {
right: 0;
}
.page {
background: white;
position: absolute;
top: 0;
bottom: 0;
width: 50%;
}
It's not perfect, but it's pretty close to what you want :)
answered Jan 28, 2014 at 14:01
CRABOLO
8,82439 gold badges46 silver badges68 bronze badges
Comments
lang-html