Skip to content

Instantly share code, notes, and snippets.

@Rplus
Last active February 24, 2016 02:06
Show Gist options
  • Save Rplus/7671448 to your computer and use it in GitHub Desktop.
Save Rplus/7671448 to your computer and use it in GitHub Desktop.

漸層 bgi
background-image linear-gradient


讓CSS正確顯示中文字體 http://benlibra.blogspot.tw/2011/04/css.html

escape('微軟正黑體').replace(/%u/g, '\\');

=> "\5FAE\8EDF\6B63\9ED1\9AD4"


multiline ellipsis

http://zetajames.wordpress.com/2012/02/13/text-overflow/ text-overflow: ellipsis; at multi-line

{
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 6; /* 第六行要顯示點點點 */
  -webkit-box-orient: vertical;
}

Learn CSS Positioning in Ten Steps (en) http://www.barelyfitz.com/screencast/html-training/css/positioning/ (zh) http://www.see-design.com.tw/i/css_position.html

<select>
  <option disabled selected style="display: none;">請選擇</option>
  <option value="xxx">第一項</option>
</select>

效果: 預設會 selected 到第一項

  • disabled: 但點開後第一項便會被略過無法選取
  • display: none;: 下拉選單中該項隱藏

適合需要提示用的 select

@Rplus
Copy link
Author

Rplus commented Mar 20, 2015

https://cssanimation.rocks/

css animation news & cool sample

@Rplus
Copy link
Author

Rplus commented Apr 8, 2015

Javascript Chart Libraries
http://blog.webkid.io/javascript-chart-libraries/

quick overview about open source javascript chart libraries (mostly D3 based)

@Rplus
Copy link
Author

Rplus commented Apr 8, 2015

以 Firefox 開發者工具在 GitHub 上除錯 fetch()
http://blog.mozilla.com.tw/posts/7293/devtool-github-fetch

video

https://youtu.be/PUgRMRQoTq4

未讀

@Rplus
Copy link
Author

Rplus commented Apr 8, 2015

http://www.oxxostudio.tw/
認真在寫前端技術文的部落格

@Rplus
Copy link
Author

Rplus commented Apr 17, 2015

http://www.myscriptfont.com/
客製化手寫字型服務

@Rplus
Copy link
Author

Rplus commented May 20, 2015

contenteditable detect snippet
via: http://stackoverflow.com/a/18316972/3893926

主要修正 Chrome 支援 rich-text 輸入方式
在一些需純文字區塊會有 copy & paste 卻帶有 style 的狀況

var isSupportsPlaintextEditable = (function () {
    var div = document.createElement('div');
    div.setAttribute('contenteditable', 'PLAINTEXT-ONLY');

    return div.contentEditable === 'plaintext-only';
})();

console.log(isSupportsPlaintextEditable);

@Rplus
Copy link
Author

Rplus commented May 20, 2015

http://howtocenterincss.com/
各式 center 方式

@Rplus
Copy link
Author

Rplus commented Jun 28, 2015

  • asda
  • asdasd

@Rplus
Copy link
Author

Rplus commented Dec 10, 2015

http://navnav.co/
很多選單的 demo
layout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment