• Skip to main content
  • Skip to search
  • Skip to select language
MDN Web Docs
  • 参考手册
    • 概述 / Web 技术

      适用于开发者的 Web 技术参考手册

    • HTML

      Web 内容的结构

    • CSS

      用于描述文档样式的代码

    • JavaScript

      通用脚本语言

  • 开发指南
    • 概述 / MDN 学习区

      学习 Web 开发

    • MDN 学习区

      学习 Web 开发

    • HTML

      学习使用 HTML 构建 Web 内容

    • CSS

      学习使用 CSS 设置内容样式

    • JavaScript

      学习在浏览器中运行脚本

  • 更多中文网
  1. 面向开发者的 Web 技术
  2. CSS:层叠样式表
  3. fit-content

目录

  • Syntax
  • Examples
  • Specifications
  • Browser compatibility
  • See also
  1. CSS
  2. 教程
  3. CSS 基础知识
  4. CSS 第一步
    1. CSS 第一步概述
    2. 什么是 CSS?
    3. CSS 入门
    4. CSS 的结构如何
    5. CSS 的工作原理
    6. 评估:设计传记页面
  5. CSS 构建块
    1. CSS 构建块概述
    2. CSS 选择器
    3. 类型、类别和 ID 选择器
    4. 属性选择器
    5. 伪类和伪元素
    6. 组合器
    7. 级联、特异性和继承
    8. 级联层
    9. 盒子模型
    10. 背景和边框
    11. 处理不同的文本方向
    12. 内容溢出
    13. CSS 值和单位
    14. 在 CSS 中调整项目大小
    15. 图片、媒体和表单元素
    16. 样式表
    17. 调试 CSS
    18. 组织你的 CSS
    19. 评估:基本 CSS 理解
    20. 评估:制作精美的信头纸
    21. 评估:一个很酷的盒子
  6. 设置文本样式
    1. 设置文本概览样式
    2. 基本文本和字体样式
    3. 样式列表
    4. 设置链接样式
    5. 网页字体
    6. 评估:排版社区学校主页
  7. CSS 布局
    1. CSS 布局概述
    2. CSS 布局简介
    3. 正常流量
    4. 弹性盒
    5. 网格
    6. 花车
    7. 定位
    8. 多列布局
    9. 响应式设计
    10. 媒体查询初学者指南
    11. 传统的布局方法
    12. 支持旧版浏览器
    13. 评估:基本布局理解
  8. 参考
  9. Modules
    1. CSS anchor positioning
    2. CSS animations
    3. CSS backgrounds and borders
    4. CSS basic user interface
    5. CSS box alignment
    6. CSS box model
    7. CSS box sizing
    8. CSS cascade and inheritance
    9. CSS custom properties for cascading variables
    10. CSS color adjustment
    11. CSS colors
    12. CSS compositing and blending
    13. CSS conditional rules
    14. CSS containment
    15. CSS counter styles
    16. CSS display
    17. CSS filter effects
    18. CSS flexible box layout
    19. CSS font loading
    20. CSS fonts
    21. CSS fragmentation
    22. CSS generated content
    23. CSS grid layout
    24. CSS images
    25. CSS lists and counters
    26. CSS logical properties and values
    27. CSS masking
    28. CSS media queries
    29. CSS miscellaneous
    30. CSS motion path
    31. CSS multi-column layout
    32. CSS namespaces
    33. CSS nesting
    34. CSS overflow
    35. CSS overscroll behavior
    36. CSS paged media
    37. CSS positioned layout
    38. CSS properties and values API
    39. CSS pseudo-elements
    40. CSS ruby layout
    41. CSS scoping
    42. CSS scroll-driven animations
    43. CSS scroll snap
    44. CSS scrollbars styling
    45. CSS selectors
    46. CSS shadow parts
    47. CSS shapes
    48. CSS syntax
    49. CSS table
    50. CSS text
    51. CSS text decoration
    52. CSS transforms
    53. CSS transitions
    54. CSS writing modes
    55. CSSOM view
  10. Properties
    1. -moz-*
      1. -moz-float-edge Non-standard Deprecated
      2. -moz-force-broken-image-icon Non-standard Deprecated
      3. -moz-image-region Non-standard
      4. -moz-orient Non-standard
      5. -moz-user-focus Non-standard Deprecated
      6. -moz-user-input Non-standard Deprecated
    2. -webkit-*
      1. -webkit-border-before Non-standard
      2. -webkit-box-reflect Non-standard
      3. -webkit-line-clamp
      4. -webkit-mask-box-image Non-standard
      5. -webkit-mask-composite Non-standard
      6. -webkit-mask-position-x Non-standard
      7. -webkit-mask-position-y Non-standard
      8. -webkit-mask-repeat-x Non-standard
      9. -webkit-mask-repeat-y Non-standard
      10. -webkit-tap-highlight-color Non-standard
      11. -webkit-text-fill-color
      12. -webkit-text-security Non-standard
      13. -webkit-text-stroke
      14. -webkit-text-stroke-color
      15. -webkit-text-stroke-width
      16. -webkit-touch-callout Non-standard
    3. accent-color
    4. align-*
      1. align-content
      2. align-items
      3. align-self
    5. all
    6. anchor-name Experimental
    7. animation-*
      1. animation
      2. animation-composition
      3. animation-delay
      4. animation-direction
      5. animation-duration
      6. animation-fill-mode
      7. animation-iteration-count
      8. animation-name
      9. animation-play-state
      10. animation-range Experimental
      11. animation-range-end Experimental
      12. animation-range-start Experimental
      13. animation-timeline Experimental
      14. animation-timing-function
    8. appearance
    9. aspect-ratio
    10. backdrop-filter
    11. backface-visibility
    12. background-*
      1. background
      2. background-attachment
      3. background-blend-mode
      4. background-clip
      5. background-color
      6. background-image
      7. background-origin
      8. background-position
      9. background-position-x
      10. background-position-y
      11. background-repeat
      12. background-size
    13. block-size