Ruby on Rails: apply drop shadow with Carrierwave

流过昼夜 提交于 2019-12-12 04:48:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!