ericltw / notes

0 stars 1 forks source link

CSS / Implement Component - A #48

Open ericltw opened 4 years ago

ericltw commented 4 years ago

Introduction to CSS

CSS是一種stylesheet language,目的是描述HTML / XML的呈現(實際上,CSS經過parse,將style附加到DOM node)。也就是HTML定義了structure,而CSS在structure上添加style。

ericltw commented 4 years ago

Styling text

ericltw commented 4 years ago

CSS building blocks

ericltw commented 4 years ago

Organizing CSS code

organizing CSS code的目的在於增加CSS code的維護性。以下介紹兩種組織CSS code的方式:

Reference
ericltw commented 4 years ago

CSS Layout

Normal Flow

normal flow指的是當不設置任何CSS layout style時,瀏覽器默認情況下如何佈局HTML頁面 (block / inline elements)。當使用CSS layout style,代表你正在將改變默認的HTML頁面布局。

Writing Mode

定義了inline base direction和block flow direction。

CSS Layout Style

Display

display-outside
display-inside
display-listitem
display-legacy

Float

Positioning

基於basic document flow behavior做element呈現位置的修正。

display與position的差異在於,display著重在大區塊的佈局,而position是在display的基礎下,對element的位置進行修飾,以能夠更精準的控制element的位置,這也是為什麼position property時常會搭配像是top, left的property共同使用,但display沒有。

Reference

ericltw commented 4 years ago

white-space

介紹

決定如何處理element的空白。

Property

overflow

介紹

overflow property決定如果內容溢出element box時會發生什情況。

Property

text-overflow

介紹

設置如何向用戶發送隱藏溢出內容的信號,僅當container's overflow property值設為hidden, scroll, auto時才可能會發生text overflow。

Property

Reference

ericltw commented 2 years ago

https://wcc723.github.io/css/2017/07/21/css-flex/