问题
How do I apply a drop shadow to my images saved with carrierwave? I can't find any examples on how to do this.
Update: Example for adding a shadow to images with CSS. You can remove the padding and margin if you don't like the white 1px border around the image. It looks nice though...
.dropSmallShadow {
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.255);
margin-left: 1px;
padding: 1px;
}
Best regards Asbjørn Morell
回答1:
My recommendation is to not add the border/dropshadow in the image (since you may want to display them differently later on), but instead add them using CSS.
for example, you can add a 5 px white padding around the image, and then a box-shadow using http://www.css3.info/preview/box-shadow/
IE will degrade to just having the white border like a polaroid.
来源:https://stackoverflow.com/questions/5430107/ruby-on-rails-apply-drop-shadow-with-carrierwave