We would like to know how to center div with width and right settings.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.productImg {<!-- ww w . ja va 2 s . co m-->
width: 50%;
position: absolute;
right: 25%;
background-color: red;
height: 200px;
}
</style>
</head>
<body>
<div class=productImg></div>
</body>
</html>
The code above is rendered as follows: