CSS阴影3侧

问题描述:

我在看所有的CSS阴影教程,这是伟大的。不幸的是,我需要在块元素的三边(左,底,右)上放一个阴影。所有的教程都讨论了向上和向左移动你的块元素。

I'm looking at all the CSS Drop shadow tutorials, which are great. Unfortunately, I need to put a shadow on three sides of a block element (left, bottom, right). All the tutorials talk about shifting your block element up and to the left. Anyone have insights into putting a shadow on three or even four sides?

感谢大家。我最后这样做的方式是这样:

Thanks everyone. The way I ended up doing it was sorta like this:

<div id="top_margin"></div>
<div id="left_right_shadow">this div has a 5 px tall repeating background that is a bit bigger than the width of my content block, shadow on the left, white space, shadow on the right
  <div id="content">Content as normal</div>
</div>
<div id="bottom_margin">This has the bottom shadow</div>