Tuesday, February 21, 2012

css - center image inside overflow-hidden-parent - Stack Overflow

css - center image inside overflow-hidden-parent - Stack Overflow: "
Then, match it with this CSS:

div {
  width: 50px;
  height: 50px;
  background: transparent url(...) center center no-repeat;
  border: 1px solid #000;
}
div a {
  display: block;
  height: 100%;
  text-indent: -9999em; /* Hides the link text */
}
In this case, the background will be automatically centered regardless of its dimensions, and it'll still be clickable."

'via Blog this'