Reputation: 31323
Is it possible to create the following using CSS only?
I have created the container and the rounded corners. Fiddle here.
But I don't know how to get the slight shiny effect. Is it possible to do this in CSS? If so how?
Below is the code I have written so far.
HTML
<div id="phone-outer">
<div id="phone-inner">
</div>
</div>
CSS
#phone-outer {
margin-bottom:200px;
margin:0 auto;
width:400px;
height:500px;
background-color:#333;
-webkit-border-bottom-right-radius:25px;
-webkit-border-bottom-left-radius:25px;
-moz-border-radius-bottomright:25px;
-moz-border-radius-bottomleft:25px;
border-bottom-right-radius:25px;
border-bottom-left-radius:25px;
}
#phone-inner {
margin:0 auto;
background-color:#FFF;
width:360px;
height:460px;
}
Upvotes: 4
Views: 18652
Reputation: 2984
Close enough I hope:
#phone-outer {
border: 1px solid #FFFFFF;
border-bottom-left-radius: 25px;
border-bottom-right-radius: 25px;
box-shadow: 0 3px 0.7px 1px #777777, 0 -7px rgba(0, 0, 0, 0.4) inset;
height: 500px;
width: 400px;
margin: 0 auto;
background-image: linear-gradient(right, #111 11%, #333 56%);
background-image: -o-linear-gradient(right, #111 11%, #333 56%);
background-image: -moz-linear-gradient(right, #111 11%, #333 56%);
background-image: -webkit-linear-gradient(right, #111 11%, #333 56%);
background-image: -ms-linear-gradient(right, #111 11%, #333 56%);
background-image: gradient(right, #111 11%, #333 56%);
}
Upvotes: 16
Reputation: 108510
If you are looking for the subtle gradient glow, something like this should do it:
background:#222 -webkit-radial-gradient(20% 80%, 60% 60%, rgba(255,255,255,.15), rgba(255,255,255,0));
This is for webkit, you can apply the -moz and -o equivalents depending on your support table.
You can also add multiple box shadows to create the black shadow as well, something like:
box-shadow:0px 2px .7px 1px #777, inset 0 -7px rgba(0,0,0,.4);
Here is a demo: http://jsbin.com/opinaj/4
Upvotes: 6
Reputation: 10619
Yes, you can use the Box-Shadow property,
box-shadow:0px 0px 0px 3px #666;
Updated Fiddle is here:
UPDATE:
For that you can use border:
Updated Fiddle:
Upvotes: 2
Reputation: 10428
Play around with this a little http://www.colorzilla.com/gradient-editor/ and you may be able to figure something out. A background image would be much easier though. Any reason why you can't just use that image?
Upvotes: 0