Tag: tips

  • Code Corner

    New thing I learned today: text-overflow: elipsis and rem units

    You can truncate a line of text with an elipses (or other string) at the end.

    Doesn’t work for multi-line text blocks. Browser limited to firefox 7+.

    text-overflow: elipsis;
    white-space: nowrap;
    overflow: hidden;

    You can also use rem for units instead of ems

    Reference: Jonathan Snook

    html { font-size: 62.5%; } /* bases font size = 10px */
    body { font-size: 14px; font-size: 1.4rem; } /* 14px */
    h1 { font-size: 24px; font-size: 2.4rem; } /* 24px */