This is the best I could get in a couple of minutes, I think it does the job. Best of all its simplicity (only 3 edits of your css)
Position D1 is a shadow, so the right edge has a negative value (-4px is enough to hide it)
Give the relative positioning of the divs so that we can control their stacking order.
Give D1 a higher z-index than D2 to mask the top of the shadow D2.
#one { width: 100px; height: 100px; background: #FFF; -moz-box-shadow: -4px 0 3px 1px rgba(0,0,0,0.3); -webkit-box-shadow: -4px 0 3px 1px rgba(0,0,0,0.3); box-shadow: -4px 0px 3px 1px rgba(0,0,0,0.3); float:left; position: relative; z-index: 20; } #two { width: 100px; height: 300px; background: #FFF; -moz-box-shadow: 0 0 3px 1px rgba(0,0,0,0.3); -webkit-box-shadow: 0 0 3px 1px rgba(0,0,0,0.3); box-shadow: 0 0 3px 1px rgba(0,0,0,0.3); float:left; z-index: 5; position: relative; }
source share