Replace overflow hack with keyframe animation hack for suppressing screen twitching; Handle both content-box and border-box styling