-9999PX

So popular was this method, we made a tee shirt out of it, and it sold, baby, it sold.

But despite its enduring popularity, Phark has drawbacks of its own: chiefly, a performance hit caused by the need to draw a giant 9999px box offscreen. (Yes, the browser really does this.)

My friend Scott Kellum, design director at Treesaver, has now sent me this refactored code for hiding text, which I hereby christen the Kellum Method:

.hide-text {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}

  • Really long strings of text will never flow into the container because they always flow away from the container.
  • Performance is dramatically improved because a 9999px box is not drawn. Noticeably so in animations on the iPad 1

'HTML & Script' 카테고리의 다른 글

http://code.google.com/p/ie7-js/  (0) 2012.03.31
iscroll로 overflow scroll 효과 내기  (0) 2012.03.31
클립보드 복사 기능 구현을 위한 소스 코드  (0) 2012.03.15
키코드값  (0) 2012.03.15
소스보기 막기 몇 종류  (0) 2012.03.14

+ Recent posts