Skip to content

Latest commit

 

History

History
86 lines (50 loc) · 4.7 KB

css.md

File metadata and controls

86 lines (50 loc) · 4.7 KB

CSS (Cascading Style Sheets)

  • CSS 是用來描述 HTML/XML 文件該如何在不同媒體上表現 (presentation) 的 stylesheet language,可能的媒體有 screen、paper 等。
  • 按 level 逐步開發推展,CSS1 已經淘汰 (obsolete),目前 CSS2.1 是推薦 (recommendation),而 CSS3 則切分成不同 module,逐步標準化中。

參考資料:

CSS 跟平面印刷、語音等表現有關?

基礎

Hello, World! ??

新手上路 ??

參考資料:

Data Type ??

Length ??

  • - CSS: Cascading Style Sheets | MDN #ril
    • <length> 表示 distance value,由 <number> (可能是負數) 及一個 unit 構成,跟其他 CSS 尺寸 (dimensions) 一樣,在 number 與 unit literal 間不能有空白;當然,如果 number 是 0,那後面的 unit 就可有可無。
    • Unit 大致分為 relative 與 absolute 兩類。

Specificity ??

如何寫註解?

  • CSS 裡註解的表示法只有一種 /* ... */,可以寫成單行,也可以橫跨多行,但不能交疊 (nested)。

參考資料:

設定 width/height 時,padding、border 跟 margin 有沒有算在內?

  • 不算在內。設定 width/height 時是針對 content,所以整個 box 的大小要另外把 padding、border 及 margin 算進來。

參考資料:

  • CSS Box Model https://www.w3schools.com/css/css_boxmodel.asp 由內而外,box model 由 content、padding、border 與 margin 組成,其中 padding 跟 margin 都是透明的;當設定 width/height 時,是指 content area,所以 full size 要另外把 padding、border、margin 加進來。

Selector ??

如何設定字型?

Unit ??

參考資料 {: #reference }

社群:

手冊: