问题
I am having a menu which uses Css3 effects on its hover and active state.The menu looks like this

Here is the Css3 styling I use
#Menu a:active,
#Menu a.active:before,#Menu a:hover:before
{
Content: ' ';
position:absolute;
z-index:51;
width:0px;
height:0px;
left:50%;
top:50%;
box-shadow:0 0 35px 30px #ADD7E7;
-moz-box-shadow:0 0 35px 30px #ADD7E7;
-webkit-box-shadow:0 0 35px 30px #ADD7E7;
border-radius:50%;
}
This works in Firefox and Chrome , but doesnot work in opera , I have no idea , can anybody help me out with this.Any help is much appreciated. Thanks
回答1:
It seems Opera needs the pseudo element to have a width and height (other than 0px
).
Just tried the following code in Opera 11.62 and it appeared to work.
#Menu a:active,
#Menu a.active:before,#Menu a:hover:before
{
Content: '';
position:absolute;
z-index:51;
width:1px;
height:1px;
left:50%;
top:50%;
background: #ADD7E7;
box-shadow:0 0 35px 30px #ADD7E7;
-moz-box-shadow:0 0 35px 30px #ADD7E7;
-o-box-shadow:0 0 35px 30px #ADD7E7;
border-radius:50%;
}
回答2:
Try this code
HTML
<div class="shadow-bringer shadow"> HI ! Welcome. </div>
CSS
.shadow-bringer {
background: none repeat scroll 0 0 #FFFFA2;
height: 100px;
margin: 20px auto;
padding: 5px;
width: 100px;
}
.shadow {
box-shadow: 0 0 8px #CCCCCC;
-moz-box-shadow: 0px 0px 8px #ccc;/* for mozila*/
-webkit-box-shadow: 0px 0px 8px #ccc;
/* For IE upto 5.5 not for 9*/
filter: progid:DXImageTransform.Microsoft.Shadow(color='#cccccc', Direction=45, Strength=3)
progid:DXImageTransform.Microsoft.Shadow(color='#cccccc', Direction=135, Strength=3)
progid:DXImageTransform.Microsoft.Shadow(color='#cccccc', Direction=225, Strength=3)
progid:DXImageTransform.Microsoft.Shadow(color='#cccccc', Direction=315, Strength=3);
}
For more info visit : 1.http://webdesignergeeks.com/tutorials/html-css-tutorials/cross-browser-drop-shadow-for-all-side/
2.http://css-tricks.com/snippets/css/css-box-shadow/
回答3:
According css3please, this should work :
.box_shadow {
-webkit-box-shadow: 0px 0px 4px 0px #ffffff; /* Saf3-4, iOS 4.0.2 - 4.2, Android 2.3+ */
box-shadow: 0px 0px 4px 0px #ffffff; /* Opera 10.5, IE9, FF4+, Chrome 6+, iOS 5 */
}
Check whether this works in your opera : http://css3please.com/
来源:https://stackoverflow.com/questions/10477517/css3-box-shadow-effect-not-working-in-opera