2017/03/30

【網頁工具】在網頁上使用Google免費提供的「思源黑體」WebFont

Noto Sans TC (Chinese Traditional)

Noto is a font family that aims to support all languages in the world. This is the Sans Traditional Chinese family. It has Thin, Light, Regular, Medium, Bold and Black styles. For more information about Noto, go to google.com/get/noto

Noto Sans TC has been subsetted to the most frequent 7,800 Chinese characters in Traditional Chinese documents. 223 characters are added to cover all the characters in Taiwan's CNS 11643 P1 and 常用國字標準字體表 as well as Hong Kong's 常用字字形表 and IRG HB0 and HB1. In addition to Hanzi, Bopomofo, CJK Radicals, ASCII, punctuation marks and full-width characters are included. The full version can be downloaded in the link below. For more details, see Noto CJK Help.

Link
@import url(//fonts.googleapis.com/earlyaccess/notosanstc.css);
Example
font-family: 'Noto Sans TC', sans-serif;

SIL Open Font License, 1.1 | Download

來源:https://fonts.google.com/earlyaccess#Noto+Sans+TC

2016/04/03

【CSS】過長的字省略為... (三個點)

DEMO
歡迎來到Jeff x Developer,這裡有許多小編在前端開發所用的技術紀錄。
CSS
div {
    overflow : hidden;
    text-overflow : ellipsis;
    white-space : nowrap;
    width : 200px;
}

補充說明:

該CSS效果只能應用在單行的情形,若要多行則必須在Server程式端或使用Javascript進行字串的處理。(超出某長度則截斷以...取代)