does anybody know if there’s a way to create an CSS effect which looks like the light effect used for iPhone apps? I mean the upper, brighter part of the box.
Thanks,
Ron

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Unfortunately since using
:afterand:beforeselectors onimgelements is not covered by the specification, a pure CSS solution might not behave correctly:In the current versions of Chrome and Firefox, these selectors appear to be ignored and simply don’t work on
imgelements.Here’s a solution with a small HTML wrapper that will fall back to not rendering when the CSS isn’t supported. The container size needs to be specified here, but that could easily be set with JavaScript.
CSS
HTML
Result
To make this a little fancier, you could add a gradient background to
.shine:after, but it works fine without to demonstrate the idea.Here’s a jsFiddle so you don’t have to take my word for it.