Note that there are some explanatory texts on larger screens.

plurals
  1. PO@font-face Fonts Cropped When Using CSS3 keyframe Animations
    primarykey
    data
    text
    <p>I have four absolutely positioned divs that fade in and move using a css3 <code>@-webkit-keyframe</code> animation. What I've noticed is that some serifs and descenders of the <code>@font-face</code> I'm using get cropped at the automatically calculated edge of the div. (I'm using <code>text-align: left</code>, so I only notice this on the left and bottom edges of the div.</p> <p>I can work around this problem by defining fixed sizes for the divs, and changing to <code>text-align: center</code>, but I'm curious if there is a better way to fix this, so I don't have to change the size of the divs if the text changes or if I need to change the <code>font-size</code>.</p> <p>Edit: here is some code to give you an idea of what I'm doing</p> <pre><code>div#text_2 { position: absolute; top: 288px; left: 100px; font-size: 65px; color: #C0DB81; font-family: 'TFArrow-Medium'; /* This is defined in another css file */ -webkit-animation-delay: 0s; -webkit-animation-timing-function: cubic-bezier(0, 0, 0.35, 1.0); -webkit-transform: translateZ(0); -webkit-animation-duration: 4s; -webkit-animation-name: text_fade_in2; } @-webkit-keyframes text_fade_in2 { 0% { opacity: 0; } 25% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 1; } } </code></pre> <p>This fixes the cropping issue:</p> <pre><code>div#text_2 { position: absolute; top: 288px; left: 100px; font-size: 65px; color: #C0DB81; font-family: 'TFArrow-Medium'; /* This is defined in another css file */ -webkit-animation-delay: 0s; -webkit-animation-timing-function: cubic-bezier(0, 0, 0.35, 1.0); -webkit-transform: translateZ(0); -webkit-animation-duration: 4s; -webkit-animation-name: text_fade_in2; height: 65; /* 60px is the auto-calculated height in Safari */ } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload