changeImageOnParentClass

by vickykumarui

HTML

<body class="dark">
<img class="image-replacement"  />


</body>

CSS

.dark .image-replacement {
  display: block;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  background: url(http://akamaicovers.oreilly.com/images/9780596517748/cat.gif) no-repeat;
  width: 180px;
  height: 236px;
  padding-left: 180px;
}

.light .image-replacement {
  display: block;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  background: url(http://ashlandtech.org/wp-content/uploads/2014/09/1.png) no-repeat;
  width: 180px;
  height: 236px;
  padding-left: 180px;
}