萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 程式設計 >  >> 網頁製作 >> Div CSS 教學

CSS 必背核心屬性速查表:文字、字體、背景、列表、盒模型、定位、CSS3 新特性

文字

  • color 文字顏色
  • text-align 對齊
  • text-decoration 下劃線/刪除線
  • text-transform 大小寫轉換
  • line-height 行高
  • letter-spacing 字元間距

字體

  • font-family 字體族
  • font-size 字體大小
  • font-style 斜體/正常
  • font-weight 粗細

背景

  • background-color 背景色
  • background-image 背景圖
  • background-repeat 重複方式
  • background-position 位置(預設 top left)

列表

  • list-style-type 列表樣式(circle 等)

盒模型

  • margin 外邊距(透明)
  • padding 內邊距(透明)
  • border 邊框(不透明,**必須設定樣式否則無效**)
  • float 浮動(絕對定位一種,脫離文檔流,佔位空間消失)
  • clear 清除浮動(清除包含塊的浮動)

定位與偽元素

  • :after / :before 常搭配 position 使用
  • position: relative 相對定位(佔位空間保留)
  • position: absolute 絕對定位(佔位空間消失)
  • 應用例:微信小紅點訊息通知

CSS3 新特性

  • border-radius 圓角(含 -webkit-、-moz- 前綴),語法:單一半徑值
  • box-shadow 陰影(含前綴),語法:h-shadow v-shadow blur spread color | inset | initial | inherit
  • text-shadow 文字陰影,語法:h-shadow v-shadow blur-radius color | none | initial | inherit
  • Multiple Backgrounds 多重背景圖
  • background-size 背景尺寸控制
  • text-overflow 文字溢出處理:clip | ellipsis | string | initial | inherit
  • Flexible Box Model / transform:2D/3D 縮放、平移、旋轉
copyright © 萬盛學電腦網 all rights reserved