0

I have a span which is centered horizontally and vertically in its parent with the following CSS:

.cal-day {
  font-size: 1.8em;
  top: 50%;
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
}
<div class="calendar-button">
  <a href="#">
    <span class="icon-calendar"></span>
    <span class="cal-day">21</span>
  </a>
</div>

(.icon-calendar is an icomoon-font, position is relative to make the parent div create space)

This works in Chrome and Safari. in Firefox, the container is a few pixels off to the top (I attached an image).

I guess, it's the font that is being rendered different in FF/Chrome... But how can I make them render it equally?

enter image description here

Any ideas?

athi
  • 1,683
  • 15
  • 26
Swissdude
  • 3,486
  • 3
  • 35
  • 68

0 Answers0