What is the best semantic and valid method to make drop shadow around whole #wrapper? on all side. horizontally can be fixed but vertically should be expandable.
相关问题
- Adding a timeout to a render function in ReactJS
-
Why does the box-shadow property not apply to a
- Add animation to jQuery function Interval
- jQuery hover to slide?
- Issue with star rating css
If you are willing to go with another, non semantic method for IE, you could simply use CSS 3 for current (Webkit and Gecko based) browsers:
(source: css3.info)
Of course, for IE you have a few other options.
Use a single image for the background with a drop shadow.
Use some CSS trickery to have a few wrapper divs with some small borders that composite the shadow.
Use javascript to create the drop shadow.
The last one has the advantage of given you the chance of using the CSS
box-shadow
on CSS3 enabled browsers, and the Javascript drop shadow on the rest (IE/Opera).Shadows can hardly be made semantically correct since they have no meaning. It's just a decoration (presentation) element.
If the width is fixed I wouldn't use a wrapper I'd do like that:
For
top
andbottom
classes I'd put the top and bottom shadows as a css background image.Then I'd
repeat-y
a background image representing shadows on both sides of the box.If you don't care about cross-browser compatibility, prefer using CSS3 properties.