<html>
<head>
<style type="text/css">
div {
-moz-box-shadow: 0 10px 10px hsla(0, 0%, 0%, .2);
-webkit-box-shadow: 0 10px 30px hsla(0, 0%, 0%, .2);
box-shadow: 0 10px 30px hsla(0, 0%, 0%, .2);
}
div:hover {
width:200px;
background-color:red;
}
</style>
</head>
<body>
<? $dynamic_width=800; ?>
<div style=" width:<? echo $dynamic_width;?>px;">hover selector style links on mouse-over.
<div>
</body>
</html>
In above code the width of div: hover not changes with mouseover. div width should change according to “$dynamic_width” veriable and on mouse over it should be 200px
As the element style takes precedence over a more general style, the 200px from the :hover pseudo class are never applied.
Try:
demo: http://jsfiddle.net/bn2Sc/1/