It seems like there is an issue in Safari 9.1.3 where the border width on elements with a specific combination of styles is causing unexpected outcomes. Essentially, I am using a transform on an absolutely positioned element to achieve horizontal centering on an element with variable width.
HTML:
<div class="border">
<div class="border__text">
test
</div>
</div>
CSS
.border {
position: absolute;
left: 50%;
padding: 50px;
border: 1px solid #666666;
transform: translateX(-50%);
}
.border__text {
font-size: 12px;
font-style: italic;
font-family: "Times New Roman", Times, serif;
}
Screenshot
https://i.sstatic.net/xD3Xg.png
Codepen
I have been able to make it work by adjusting the font size to either 11 or 13 pixels, but my preference is for it to be at 12 pixels. Additionally, removing the transform allows it to work, but I'm struggling to find another simple way to horizontally center an absolutely positioned element.